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