mirror of
https://github.com/xlucn/PAT.git
synced 2026-02-06 02:02:38 +08:00
21 lines
296 B
C
21 lines
296 B
C
#include <stdio.h>
|
|
|
|
long Dpart(long A, int D_A)
|
|
{
|
|
long P_A;
|
|
for (P_A = 0; A; A /= 10)
|
|
if (A % 10 == D_A)
|
|
P_A = P_A * 10 + D_A;
|
|
return P_A;
|
|
}
|
|
|
|
int main()
|
|
{
|
|
long A, B;
|
|
int D_A, D_B;
|
|
scanf("%ld %d %ld %d", &A, &D_A, &B, &D_B);
|
|
printf("%ld", Dpart(A, D_A) + Dpart(B, D_B));
|
|
|
|
return 0;
|
|
}
|