Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Globalization;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _07.TravellCompany
- {
- class Program
- {
- static void Main(string[] args)
- {
- List<int> list = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
- string com = Console.ReadLine();
- double av = list.Average();
- List<int> list1 = new List<int>();
- list1 = list.Where(x => x >= (int)av).Select(x => x).ToList();
- switch (com)
- {
- case "Min":
- Console.WriteLine(list1.Min());
- break;
- case "Max":
- Console.WriteLine(list1.Max());
- break;
- case "All":
- Console.WriteLine(string.Join(" ", list1.OrderBy(x => x)));
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement