Stan0033

Untitled

Jun 21st, 2021
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 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. Console.WriteLine(biggestNums[counter]);
  19.  
  20. Console.WriteLine();
  21. for (int i = 0; i < nums.Length+1; i++)
  22. {
  23.  
  24. for (int x = i+1; x < nums.Length; i++)
  25. {
  26. int first = Convert.ToInt32(nums[i]);
  27. int second = Convert.ToInt32(nums[x]);
  28.  
  29. if (first > second) { biggestNums[counter] = first; counter++; }
  30.  
  31.  
  32. }
  33.  
  34.  
  35. }
  36. for (int i = 0; i < counter; i++)
  37. {
  38.  
  39. Console.Write($"{biggestNums[i]} ");
  40.  
  41. }
  42. for (int i = 0; i < nums.Length; i++)
  43. {
  44. Console.WriteLine(Convert.ToInt32(i));
  45. }
  46. }
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment