Advertisement
Nikolay_Kashev

Min/Max values

Mar 2nd, 2024
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | Software | 0 0
  1. using System;
  2. using System.Linq;
  3.  
  4. namespace _02._Min__Max_Values
  5. {
  6. class Program
  7. {
  8. static void Main(string[] args)
  9. {
  10. var input = Console.ReadLine();
  11. int n = int.Parse(Console.ReadLine());
  12.  
  13. int[] numbers = input.Split().Take(n).Select(int.Parse).ToArray();
  14.  
  15. Console.WriteLine(numbers.Max());
  16. Console.WriteLine(numbers.Min());
  17. }
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement