0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-18 09:51:59 +00:00
OI-codes/Luogu/P6500/P6500.cpp

25 lines
634 B
C++
Raw Normal View History

// R39634200
2021-11-19 09:01:13 +00:00
#include <bits/stdc++.h>
using namespace std;
int main() {
string a, b, a_max, b_max, a_min, b_min;
cin >> a >> b;
2021-11-19 09:01:13 +00:00
for (int i = 0; i < a.size(); i++) {
if (a[i] == '6' || a[i] == '5')
a_max += '6', a_min += '5';
else
a_max += a[i], a_min += a[i];
}
2021-11-19 09:01:13 +00:00
for (int i = 0; i < b.size(); i++) {
if (b[i] == '6' || b[i] == '5')
b_max += '6', b_min += '5';
else
b_max += b[i], b_min += b[i];
}
cout << atoi(a_min.c_str()) + atoi(b_min.c_str()) << ' ' << atoi(a_max.c_str()) + atoi(b_max.c_str()) << endl;
return 0;
}