Advertisement
Guest User

Untitled

a guest
Oct 28th, 2022
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4.  
  5. namespace _01._Sort_Numbers
  6. {
  7. class Program
  8. {
  9. static void Main(string[] args)
  10. {
  11. string list = Console.ReadLine();
  12.  
  13. int[] listArray = list
  14. .Split(", ", StringSplitOptions.RemoveEmptyEntries)
  15. .Select(int.Parse)
  16. .ToArray();
  17.  
  18. Array.Sort(listArray);
  19.  
  20. int[] result = listArray
  21. .Reverse()
  22. .ToArray();
  23.  
  24. Console.WriteLine(string.Join(", ", result));
  25.  
  26. }
  27. }
  28. }
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement