Advertisement
fbinnzhivko

Untitled

Oct 22nd, 2016
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.71 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3.  
  4. class Z1
  5. {
  6.     static void Main()
  7.     {
  8.  
  9.         double[] array = Console.ReadLine().Split().Select(double.Parse).ToArray();
  10.        
  11.         double average = array.Average();
  12.  
  13.         double[] asa = array.Where(a => a > average).OrderByDescending(x => x).ToArray();
  14.        
  15.         var same = asa.ToList();
  16.         bool result = same.All(item => item == 1);
  17.        
  18.         if (result) { Console.WriteLine("No"); }
  19.         if (asa.Length >= 5)
  20.         {
  21.             double[] x = asa.Take(5).ToArray();
  22.  
  23.             Console.WriteLine(string.Join(" ", x));
  24.         }
  25.         else
  26.         {
  27.             Console.WriteLine(string.Join(" ", asa));
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement