fork download
  1. using System;
  2. namespace Sorting
  3. {
  4. class Programm
  5. {
  6.  
  7.  
  8. public static void Main(string[] args)
  9. {
  10.  
  11. int[] array = new int[10];
  12. array[0] = 25;
  13. array[1] = 15;
  14. array[2] = 154;
  15. array[3] = 145;
  16. array[4] = 19;
  17. array[5] = 88;
  18. array[6] = 5;
  19. array[7] = 45;
  20. array[8] = 14;
  21. array[9] = 10;
  22.  
  23. var result = Inciment(array);
  24.  
  25. }
  26.  
  27.  
  28. public static int[] Inciment(int[] array)
  29. {
  30. int t;
  31.  
  32. for (int i = 0; i < array.Length; i++)
  33. {
  34. for (int j = i + 1; j < array.Length; j++)
  35. {
  36. if (array[i] > array[j])
  37. {
  38. t = array[i];
  39. array[i] = array[j];
  40. array[j] = t;
  41. }
  42. }
  43. Console.WriteLine(array[i] + ", ");
  44. }
  45. return array;
  46. }
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53. }
  54. }
  55.  
Success #stdin #stdout 0.03s 16060KB
stdin
Standard input is empty
stdout
5, 
10, 
14, 
15, 
19, 
25, 
45, 
88, 
145, 
154,