Advertisement
skipter

C# Fundamentals - Count of Integers

Jun 3rd, 2017
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.63 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace ConsoleApp9
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.  
  13.             int integers = 0;
  14.             int counter = 0;
  15.             try
  16.             {
  17.                 while ((int) integers == (int) integers)
  18.                 {
  19.                     integers = int.Parse(Console.ReadLine());
  20.                     counter++;
  21.                 }
  22.             } catch (Exception ex)
  23.             {
  24.                 Console.WriteLine(counter);
  25.             }        
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement