#include <iostream>
using namespace std;
int main()
{
int a, b, c, a1, b1, cx;
cin >> a >> b >> c >> a1 >> b1 >> c1;
int am, bm, cm, a1m, b1m, c1m;
if( a >= b && a >= c && c <= b & a1 >= b1 && a1 >= c1 && c1 <= b1)
{am = a; bm = b; cm = c; a1m = a1; b1m = b1; c1m = c1;}
else if(b >= a && b >= c && a <= c && b1 >= a1 && b1 >= c1 && a1 <= c1)
{am = b; bm = c; cm = a; a1m = b1; b1m = c1; c1m = a1;}
else if (c >= a && c >= b && a <= b && c1 >= a1 && c1 >= b1 && a1 <= b1)
{am = c; bm = b; cm = a; a1m = c1; b1m = b1; c1m = a1;}
else if (c >= a && c >= b && b <= a && c1 >= a1 && c1 >= b1 && b1 <= a1)
{am = c; bm = a; cm = b; a1m = c1; b1m = a1; c1m = b1;}
else if(a >= b && a >= c && b <= c && a1 >= b1 && a1 >= c1 && b1 <= c1)
{am = a; bm = c; cm = b; a1m = a1; b1m = c1; c1m = b1;}
else if (b >= a && b >= c && c <= a && b1 >= a1 && b1 >= c1 && c1 <= a1)
{am = b; bm = a; cm = c; a1m = b1; b1m = a1; c1m = c1;}
cout << am << bm << cm << " " << a1m << b1m << c1m;
return 0;
}
a >= b && a >= c && c <= b
второе не нужно. Можно просто писать: c <= b && b <= a
.if (a >= b) {
// куча сравнений
} else {
// ещё одна куча
}