#include <cstdio>
#include <cstring>
int calc(long long a, long long da) {
int aa = 0;
while(a != 0) {
if(a % 10 == da){
aa = aa * 10 + da;
}
a /= 10;
}
return aa;
}
int main() {
long long a, b, da, db;
int pa, pb;
scanf("%lld%lld%lld%lld", &a, &da, &b, &db);
pa = calc(a, da);
//printf("%d-----\n", pa);
pb = calc(b, db);
//printf("%d-----\n", pb);
int sum = pa + pb;
printf("%d\n", sum);
return 0;
}
转载于:https://www.cnblogs.com/isChenJY/p/11184460.html