Advertisement
koksibg

Count_the_Integers

Jun 3rd, 2017
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.44 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Count_the_Integers
  4. {
  5.     class Count_the_Integers
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int count = 0;
  10.             int number;
  11.             bool result = true;
  12.             while (result)
  13.             {
  14.                 result = int.TryParse(Console.ReadLine(), out number);
  15.                 if (result) count++;
  16.             }
  17.             Console.WriteLine(count);
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement