Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Largest_Elemnt_In_Array
- {
- class Program
- {
- static void Main(string[] args)
- {
- int counter = int.Parse(Console.ReadLine());
- int[] arr = new int [counter];
- for (int i = 0; i < arr.Length; i++)
- {
- arr[i] += int.Parse( Console.ReadLine());
- }
- Console.WriteLine(FindLargestNumber(arr));
- }
- static int FindLargestNumber(int[] inputArray)
- {
- int check = int.MinValue;
- for (int i = 0; i < inputArray.Length; i++)
- {
- if (inputArray[i] > check)
- {
- check = inputArray[i];
- }
- }
- return check;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement