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;
- class Problem1
- {
- static void Main()
- {
- int[] input = Console.ReadLine().Split().Select(int.Parse).ToArray();
- double average = input.Average();
- List<int> greater = new List<int>();
- for (int i = 0; i < input.Length; i++)
- {
- if (input[i] > average)
- {
- greater.Add(input[i]);
- }
- }
- if (greater.Count() == 0)
- {
- Console.WriteLine("No");
- }
- else
- {
- var ordared = greater.OrderByDescending(i => i).Take(5);
- Console.WriteLine(string.Join(" ", ordared));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment