Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace Mark
- {
- class Program
- {
- static void Main(string[] args)
- {
- double n = double.Parse(Console.ReadLine());
- string values = Console.ReadLine();
- List<string> items = values.Split(' ').ToList();
- List<double> nums = new List<double>();
- for (int i = 0; i < n; i++)
- {
- nums.Add(double.Parse(items[i]));
- }
- List<double> query = nums.Where(x => x != nums.Min() && x != nums.Max()).ToList();
- Console.WriteLine(Math.Round(query.Average()));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement