#include<stdio.h>
int main(){
int i, a, b;
long long temp, da, db, suma=0, sumb=0;
scanf("%lld%d%lld%d",&da,&a,&db,&b);
for(temp=da;temp!=0;temp=temp/10){
if(temp%10==a) suma=suma*10+a;
}
for(temp=db;temp!=0;temp=temp/10){
if(temp%10==b)sumb=sumb*10+b;
}
printf("%lld\n",suma+sumb);
return 0;
}
PAT-B1016
最新推荐文章于 2022-10-07 10:05:54 发布