Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.ComponentModel;
- using System.ComponentModel.DataAnnotations;
- using System.ComponentModel.Design;
- using System.Globalization;
- using System.Net.Http.Headers;
- using System.Reflection;
- using System.Runtime.ConstrainedExecution;
- using System.Security.Cryptography;
- namespace SomeExcercises
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n1 = 0;
- int n = int.Parse(Console.ReadLine());
- int biggest = int.MinValue;
- int smallest = int.MaxValue;
- for (int i = 0; i < n; i++)
- {
- n1 = int.Parse(Console.ReadLine());
- if (n1 > biggest )
- {
- biggest = n1;
- }
- else if (n1 < smallest)
- {
- smallest = n1;
- }
- }
- Console.WriteLine($"Max number: {biggest}");
- Console.WriteLine($"Min number: {smallest}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment