Advertisement
medical-boy-sf

Untitled

Jan 10th, 2019
3,239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.79 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. namespace ExtraExercise_TopInteger
  6. {
  7.     class Program
  8.     {
  9.         static void Main(string[] args)
  10.         {
  11.             long[] inputArr = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
  12.            
  13.             for (long i = 0; i < inputArr.Length; i++)
  14.             {
  15.                 bool isItBigger = true;
  16.                 for (long j = i + 1; j < inputArr.Length; j++)
  17.                 {
  18.                     if (inputArr[i] <= inputArr[j])
  19.                     {
  20.                         isItBigger = false;
  21.                     }
  22.                 }
  23.  
  24.                 if (isItBigger)
  25.                 {
  26.                     Console.Write(inputArr[i] + " ");
  27.                 }
  28.             }
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement