fork download
  1. using System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4. using System.Globalization;
  5. using System.Net;
  6.  
  7.  
  8. public class Test
  9. {
  10. public static void Main()
  11. {
  12. ulong[] arr = new ulong[30];
  13.  
  14. arr[0] = 13325647855656;
  15. arr[1] = 65897426666332;
  16. arr[2] = 00685956265661;
  17. arr[4] = 0;
  18.  
  19. Array.Sort(arr, (u1, u2) =>
  20. {
  21. if (u1 == 0 && u2 == 0) return 0;
  22. else if(u1 ==0) return ulong.MaxValue.CompareTo(u2);
  23. else if (u2 == 0) return u1.CompareTo(ulong.MaxValue);
  24. else return u1.CompareTo(u2);
  25. });
  26.  
  27. foreach(var val in arr)
  28. Console.WriteLine(val);
  29. }
  30. }
  31.  
  32.  
  33.  
Success #stdin #stdout 0.03s 33784KB
stdin
Standard input is empty
stdout
685956265661
13325647855656
65897426666332
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0