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) {
  18. int aux = cb;
  19. cb = ca;
  20. ca = aux;
  21. }
  22. if (a > c) {
  23. int aux = cc;
  24. cc = ca;
  25. ca = aux;
  26. }
  27. if (b > c) {
  28. int aux = cc;
  29. cc = cb;
  30. cb = aux;
  31. }
  32. cout << ca << " " << cb << " " << cc;
  33. return 0;
  34. }
Success #stdin #stdout 0.01s 5280KB
stdin
-2 -1 -0
stdout
0 -1 -2