Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Write a program that reads from the console a sequence of N integer numbers and returns the minimal and maximal of them.
- */
- using System;
- using System.Linq;
- class MinAndMaxNumber
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- int[] numbers = new int[n];
- for (int i = 0; i < n; i++)
- {
- numbers[i] = int.Parse(Console.ReadLine());
- }
- Console.WriteLine(numbers.Max());
- Console.WriteLine(numbers.Min());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement