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