fork download
  1. #include <iostream>
  2. #include <utility>
  3. int main() {
  4. int x,y,z;
  5. while(std::cin >> x >> y >> z) {
  6. if (y<x) std::swap(x,y);
  7. if (z<y) std::swap(y,z);
  8. if (y<x) std::swap(x,y);
  9. std::cout << x << ' ' << y << ' ' << z << '\n';
  10. }
  11. }
Success #stdin #stdout 0s 2856KB
stdin
0 0 0
0 0 1
0 1 0
1 0 0
0 1 1
1 0 1
1 1 0
0 1 2
0 2 1
1 0 2
1 2 0
2 0 1
2 1 0
stdout
0 0 0
0 0 1
0 0 1
0 0 1
0 1 1
0 1 1
0 1 1
0 1 2
0 1 2
0 1 2
0 1 2
0 1 2
0 1 2