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