Advertisement
Guest User

Untitled

a guest
Jan 30th, 2017
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.76 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 ConsoleApplication3
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int n = int.Parse(Console.ReadLine());
  14.             int overflows = 0;
  15.             byte number = 0;
  16.  
  17.             for (int i = 0; i < n; i++)
  18.             {
  19.                 number++;
  20.  
  21.                 if (number == 0)
  22.                
  23.                
  24.                     overflows++;
  25.                 }
  26.                 Console.WriteLine(number);
  27.  
  28.             if (overflows > 0)
  29.             {
  30.                 Console.WriteLine("Overflowed " + overflows + " times");
  31.             }
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement