Advertisement
obedmarsh

02. Largest 3 Numbers

Jul 14th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.40 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. namespace Exam_Shopping
  6. {
  7.     class Program
  8.     {
  9.  
  10.  
  11.         static void Main(string[] args)
  12.         {
  13.             int[] arr = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
  14.             arr = arr.OrderByDescending(x => x).Take(3).ToArray();
  15.             Console.WriteLine(string.Join(" ", arr));
  16.         }
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement