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;
- using System.Text.RegularExpressions;
- using System.Numerics;
- namespace string_regEx
- {
- class Program
- {
- static void Main(string[] args)
- {
- long[] input = Console.ReadLine()
- .Split()
- .Select(long.Parse)
- .ToArray();
- while (input.Length < 5)
- {
- Console.WriteLine("No");
- input = Console.ReadLine()
- .Split()
- .Select(long.Parse)
- .ToArray();
- }
- double inputAvarage = input.Average();
- List<long> aboveAvarage = new List<long>();
- foreach (var item in input)
- {
- if (item > inputAvarage)
- {
- aboveAvarage.Add(item);
- }
- }
- Console.WriteLine(string.Join(" ", aboveAvarage.OrderByDescending(X => X).Take(5)));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement