fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int a, b, c;
  6. cin >> a >> b >> c;
  7. int ca = a, cb = b, cc = c;
  8. if (a < 0) {
  9. a = -a;
  10. }
  11. if (b < 0) {
  12. b = -b;
  13. }
  14. if (c < 0) {
  15. c = -c;
  16. }
  17. if (a <= b && b <= c) {
  18. cout << ca << " " << cb << " " << cc;
  19. }
  20. else if (a <= c && c <= b) {
  21. cout << ca << " " << cc << " " << cb;
  22. }
  23. else if (b <= a && a <= c) {
  24. cout << cb << " " << ca << " " << cc;
  25. }
  26. else if (b <= c && c <= a) {
  27. cout << cb << " " << cc << " " << ca;
  28. }
  29. else if (c <= a && a <= b) {
  30. cout << cc << " " << ca << " " << cb;
  31. }
  32. else {
  33. cout << cc << " " << cb << " " << ca;
  34. }
  35. return 0;
  36. }
Success #stdin #stdout 0.01s 5280KB
stdin
-6 -0 -1
stdout
0 -1 -6