Advertisement
braveheart1989

asd

Jun 12th, 2016
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.64 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7.  
  8. class SampleLogic
  9. {
  10.     static void Main()
  11.     {
  12.         decimal[] nums = Console.ReadLine().Split().Select(decimal.Parse).ToArray();
  13.  
  14.         decimal averageNum = nums.Sum()/nums.Length;
  15.         var result1 = nums.OrderByDescending(a => a);
  16.         var str = result1.Take(5).Where(num => num > averageNum).ToArray();
  17.         if (nums.Length <= 1 )
  18.         {
  19.             Console.WriteLine("No");
  20.        
  21.         }
  22.         else
  23.         {
  24.             Console.WriteLine(string.Join(" ", str));
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement