Advertisement
fbinnzhivko

Untitled

Oct 22nd, 2016
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.54 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. class Program
  5. {
  6.     static void Main()
  7.     {
  8.         List<int> listNums = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
  9.  
  10.         foreach (int number in listNums.OrderByDescending(x => x).Take(5))
  11.         {
  12.             if (number > listNums.Average())
  13.             {
  14.                 Console.Write(number + " ");
  15.             }
  16.         }
  17.         if (listNums.Max() <= listNums.Average())
  18.         {
  19.             Console.WriteLine("No");
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement