Advertisement
YankoGrancharov

proverkaInteger

Sep 27th, 2017
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.51 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp4
  4. {
  5.     class Program
  6.     {
  7.         static void Main()
  8.         {
  9.             int s = 0;
  10.             try
  11.             {
  12.                 int num = int.Parse(Console.ReadLine());
  13.  
  14.                 while (true)
  15.                 {
  16.                     s++;
  17.                     num = int.Parse(Console.ReadLine());
  18.  
  19.                 }
  20.  
  21.             }
  22.             catch
  23.             {
  24.                 Console.WriteLine($"{s}");
  25.                
  26.             }
  27.  
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement