-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathP131SUMD.cpp
More file actions
37 lines (31 loc) · 760 Bytes
/
P131SUMD.cpp
File metadata and controls
37 lines (31 loc) · 760 Bytes
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
28
29
30
31
32
33
34
35
36
37
#include<bits/stdc++.h>
using namespace std;
#define For(i, a, b) for(int i = a; i <= b; i++)
#define Ford(i, a, b) for(int i = a; i >= b; i--)
#define ll long long
#define here cout<<"i am here"<<endl;
const long long base= 1e9 + 7;
const int maxn = 1000000;
int change6(string a){
int s = 0;
For(i, 0, a.length() - 1){
if(a[i] == '5') a[i] = '6';
s = s*10 + (a[i] - 48);
}
return s;
}
int change5(string a){
int s = 0;
For(i, 0, a.length() - 1){
if(a[i] == '6') a[i] = '5';
s = s*10 + (a[i] - 48);
}
return s;
}
int main(void){
ios::sync_with_stdio(false);
string a,b;
cin>>a>>b;
cout<<(change5(a) + change5(b))<<" "<<(change6(a) + change6(b));
return 0;
}