fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. int a;
  8. string n;
  9. int[] ar = new int[10];
  10. a=0;
  11. //Console.WriteLine(Console.BufferHeight);
  12. while (!String.IsNullOrEmpty(n = Console.ReadLine())){
  13. //Console.WriteLine("{0}",n);
  14. ar[a]=int.Parse(n);
  15. a++;
  16. }
  17. Console.WriteLine("{0}",ar.Length);
  18. for(int j=0;j<ar.Length-1;j++){
  19. for(int k=j+1;k<ar.Length-1;k++){
  20. int tmp;
  21. if(ar[j]<ar[k]){
  22. tmp=ar[j];
  23. ar[j]=ar[k];
  24. ar[k]=tmp;
  25. }
  26. }
  27. }
  28. for(int ans=0;ans<ar.Length-1;ans++)
  29. Console.WriteLine("{0}",ar[ans]);
  30.  
  31. }
  32. }
Success #stdin #stdout 0.02s 16088KB
stdin
1
2
10
42
11
stdout
10