fork download
  1. using System;
  2.  
  3. namespace ConsoleApplication6
  4. {
  5. public class PleaseSayHelloMan
  6. {
  7. static void Main(string[] args) {
  8. int dgg=sort();
  9. Console.WriteLine(dgg);
  10.  
  11. }
  12.  
  13. static int sort()
  14. {
  15.  
  16. Random rand=new Random();
  17. int i, j, size=10000;
  18. int[] mas = new int[size];
  19.  
  20. for (i = 0; i < size; i++)
  21. {
  22. mas[i] = rand.Next(5000);
  23. }
  24. for (i = 0; i < size - 1; i++)
  25. {
  26. for (j = i + 1; j < size; j++)
  27. {
  28. if (mas[i] > mas[j])
  29. {
  30. int temp = mas[i];
  31. mas[i] = mas[j];
  32. mas[j] = temp;
  33. }
  34. }
  35. }
  36. return mas[5000];
  37. }
  38.  
  39.  
  40. }
  41. }
Success #stdin #stdout 0.54s 33992KB
stdin
Standard input is empty
stdout
2537