Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace NumberSequence
- {
- class Program
- {
- static void Main()
- {
- int input = int.Parse(Console.ReadLine());
- int bigNum = int.MinValue;
- int smallNum = int.MaxValue;
- for (int i = 1; i <= input; i++)
- {
- int num = int.Parse(Console.ReadLine());
- if (num < smallNum)
- {
- smallNum = num;
- }
- else if (num > bigNum)
- {
- bigNum = num;
- }
- }
- if (input == 0)
- {
- Console.WriteLine(0);
- }
- else if (input == 1)
- {
- bigNum = smallNum;
- } {
- Console.WriteLine($"Max number: {bigNum}");
- Console.WriteLine($"Min number: {smallNum}");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment