Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Count_the_Integers
- {
- class Program
- {
- static void Main(string[] args)
- {
- int counter = 0;
- while (true)
- {
- try
- {
- int integer = int.Parse(Console.ReadLine());
- counter++;
- }
- catch (Exception)
- {
- Console.WriteLine(counter);
- return;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement