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