Advertisement
Guest User

fostosfos

a guest
Oct 20th, 2014
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. {
  2. int[] t = new int[3];
  3. Console.WriteLine("add meg a tomb elso szamat");
  4. t[0] = Convert.ToInt32(Console.ReadLine());
  5. Console.WriteLine("add meg a tomb masodik szamat");
  6. t[1] = Convert.ToInt32(Console.ReadLine());
  7. Console.WriteLine("add meg a tomb harmadik szamat");
  8. t[2] = Convert.ToInt32(Console.ReadLine());
  9.  
  10. for (int a = 0; a < t.Length; a++)
  11. {
  12. for (int b = a+1; b < t.Length; b++)
  13. {
  14. if (t[b] < t[a])
  15. {
  16. int c = t[a];
  17. t[a] = t[b];
  18. t[b] = c;
  19. }
  20. }
  21. }
  22. for (int i = 0; i < t.Length; i++)
  23.  
  24. Console.WriteLine(t[i] + " " );
  25.  
  26. {
  27.  
  28. }
  29. }
  30. }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement