fork(1) download
  1. #include <stdio.h>
  2. int main()
  3. {
  4. int a, b, c, d, temp;
  5. scanf("%d%d%d%d", &a, &b, &c,&d);
  6. if(a>b)
  7. {
  8. temp=a;
  9. a=b;
  10. b=temp;
  11. }
  12. if(a>c)
  13. {
  14. temp=a;
  15. a=c;
  16. c=temp;
  17. }
  18. if(b>c)
  19. {
  20. temp=b;
  21. b=c;
  22. c=temp;
  23. }
  24. if(d>a)
  25. {
  26. temp=d;
  27. d=a;
  28. a=temp;
  29. }
  30. if(d>b)
  31. {
  32. temp=d;
  33. d=b;
  34. b=temp;
  35. }
  36. if(d>c)
  37. {
  38. temp=d;
  39. d=c;
  40. c=temp;
  41. }
  42. printf("%d %d %d %d\n", a, b, c, d);
  43. return 0;
  44. }
Success #stdin #stdout 0s 5328KB
stdin
10 9 8 7
stdout
8 9 10 7