Advertisement
koksibg

Max_Number

Nov 4th, 2017
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 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 Max_Number
  8. {
  9.     class Max_Number
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int n = int.Parse(Console.ReadLine());
  14.             int first = int.Parse(Console.ReadLine());
  15.             int max = first;
  16.             for (int i = 2; i <= n; i++)
  17.             {
  18.                 int num = int.Parse(Console.ReadLine());
  19.                 if (num > max) max = num;
  20.             }
  21.             Console.WriteLine(max);
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement