Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp15
- {
- class Program
- {
- static void Main(string[] args)
- {
- int count = int.Parse(Console.ReadLine());
- int biggest = int.MinValue;
- int smallest = int.MaxValue;
- for (int i = 0; i < count; i++)
- {
- int currNum = int.Parse(Console.ReadLine());
- if (currNum > biggest )
- {
- biggest = currNum;
- }
- if (currNum < smallest)
- {
- smallest = currNum;
- }
- }
- Console.WriteLine($"Max number: {biggest}");
- Console.WriteLine($"Min number: {smallest}");
- }
- }
- }
Add Comment
Please, Sign In to add comment