Advertisement
Stan0033

Untitled

Jun 21st, 2021
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3.  
  4. namespace apps
  5. {
  6. class Program
  7. {
  8. static void Main(string[] args)
  9. {
  10. static string Get() { return Console.ReadLine(); }
  11.  
  12. //-------------------------------------------------------
  13. string[] nums = Get().Split(' '); int size = nums.Length;
  14. int[] biggestNums = new int[nums.Length];
  15.  
  16.  
  17. int counter = 0;
  18.  
  19.  
  20.  
  21. for (int i = 0; i < size-1; i++)
  22. {
  23.  
  24. for (int x = i+1; x < size; x++)
  25. {
  26.  
  27. int first = Convert.ToInt32(nums[i]);
  28. int second = Convert.ToInt32(nums[x]);
  29.  
  30. if (first > second) { biggestNums[counter] = first; counter++; }
  31.  
  32.  
  33.  
  34. }
  35.  
  36.  
  37. }
  38. for (int i = 0; i < counter; i++)
  39. {
  40.  
  41. Console.Write($"{biggestNums[i]} ");
  42.  
  43. }
  44.  
  45. }
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement