Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace arrayData
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[] array = Console.ReadLine().Split().Select(int.Parse).ToArray();
- string command = Console.ReadLine();
- if (command == "All")
- {
- Console.WriteLine(string.Join(" ", array.OrderBy(x => x).Where(x => x > array.Average()).ToArray()));
- }
- else if (command == "Min")
- {
- Console.WriteLine(string.Join(" ", array.Where(x => x > array.Average()).Min()));
- }
- else if (command == "Max")
- {
- Console.WriteLine(string.Join(" ", array.Where(x => x > array.Average()).Max()));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement