fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int a, b, c;
  6. cin >> a >> b >> c;
  7. if (a <= b && b <= c) {
  8. cout << a << " " << b << " " << c << "\n";
  9. } else if (a <= c && c <= b) {
  10. cout << a << " " << c << " " << b << "\n";
  11. } else if (b <= a && a <= c) {
  12. cout << b << " " << a << " " << c << "\n";
  13. } else if (b <= c && c <= a) {
  14. cout << b << " " << c << " " << a << "\n";
  15. } else if (c <= a && a <= b) {
  16. cout << c << " " << a << " " << b << "\n";
  17. } else {
  18. cout << c << " " << b << " " << a;
  19. }
  20. return 0;
  21. }
Success #stdin #stdout 0.01s 5276KB
stdin
3 1 2
stdout
1 2 3