Advertisement
Guest User

Untitled

a guest
Nov 12th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. namespace Mark
  6. {
  7. class Program
  8. {
  9. static void Main(string[] args)
  10. {
  11. double n = double.Parse(Console.ReadLine());
  12.  
  13. string values = Console.ReadLine();
  14. List<string> items = values.Split(' ').ToList();
  15. List<double> nums = new List<double>();
  16.  
  17. for (int i = 0; i < n; i++)
  18. {
  19. nums.Add(double.Parse(items[i]));
  20. }
  21.  
  22. List<double> query = nums.Where(x => x != nums.Min() && x != nums.Max()).ToList();
  23.  
  24. Console.WriteLine(Math.Round(query.Average()));
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement