Advertisement
Aborigenius

ArrayBiggestNumber

Jun 16th, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.73 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 LargestElement
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int N = int.Parse(Console.ReadLine());
  14.             int[] myArray = new int[N];
  15.             for (int i = 0; i < N; i++)
  16.             {
  17.                 myArray[i] = int.Parse(Console.ReadLine());
  18.             }
  19.             int max = myArray.Max();
  20.             //         for (int i = 0; i < myArray.Length; i++)
  21.             //         {
  22.             //             Console.WriteLine("Element[{0}] = {1}", i, myArray[i]);
  23.             //         }
  24.             Console.WriteLine(max);
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement