Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- class Program
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- int[] array = new int [n];
- for (int i = 0; i < array.Length; i++)
- {
- Console.WriteLine("Add element {0}", i);
- array[i] = int.Parse(Console.ReadLine());
- }
- int min = array[0];
- int max = array[0];
- for (int i = 0; i < n; i++)
- {
- if (min > array[i])
- {
- min = array[i];
- }
- if (max < array[i])
- {
- max = array[i];
- }
- }
- Console.WriteLine("The lowest integer is {0}, and the highest one is {1}", min, max);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement