1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | #include <string> #include <iostream> using namespace std; int main(void) { string A, B; cin >> A >> B; string bigger; for (int i = 2; i >= 0; i––) { if (A[i] > B[i]) { bigger = A; break; } else if (A[i] < B[i]) { bigger = B; break; } } cout << bigger[2] << bigger[1] << bigger[0]; return 0; } | cs |