Advertisement
MARINA_GREBENAROVA

Max_Number

Oct 13th, 2021
1,002
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.59 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Max_Number
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string input = Console.ReadLine();
  10.             int maxNum = int.MinValue;
  11.  
  12.            
  13.             while (input!="Stop")
  14.             {
  15.                 int number = int.Parse(input);
  16.  
  17.                 if (number > maxNum)
  18.                 {
  19.                     maxNum = number;
  20.                    
  21.                 }
  22.                 input = Console.ReadLine();
  23.                    
  24.             }
  25.             Console.WriteLine(maxNum);
  26.  
  27.         }
  28.     }
  29. }
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement