Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- namespace Top_Integers_Arrays_Exercises
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[] nums = Console.ReadLine().Split(" ").Select(int.Parse).ToArray();
- for (int i = 0; i < nums.Length - 1; i++)
- {
- int currentNum = nums[i];
- bool isTopInteger = true;
- for (int j = i + 1; j < nums.Length; j++)
- {
- int otherNum = nums[j];
- if (currentNum <= otherNum)
- {
- isTopInteger = false;
- break;
- }
- }
- if (isTopInteger)
- {
- Console.Write(currentNum + " ");
- }
- }
- Console.WriteLine(nums[nums.Length - 1]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement