elena1234

Top Two numbers

Dec 4th, 2021
770
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. namespace PrintAllUniqueElementsInArray
  6. {
  7.     class Program
  8.     {
  9.         static void Main(string[] args)
  10.         {
  11.             int[] numbers = Console.ReadLine().Split().Select(int.Parse).ToArray();
  12.             var newArray =  numbers.OrderByDescending(x => x).ToArray();
  13.             Console.WriteLine(newArray[0]);
  14.             Console.WriteLine(newArray[1]);
  15.         }
  16.     }
  17. }
  18.  
RAW Paste Data