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