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