Advertisement
viraco4a

09. Count the Integers

May 22nd, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 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.  
  7. namespace _09_Count_the_Integers
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. for (int i = 0; ; i++)
  14. {
  15. try
  16. {
  17. int number = int.Parse(Console.ReadLine());
  18. }
  19. catch (Exception)
  20. {
  21. Console.WriteLine(i);
  22. break;
  23. }
  24. }
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement