1 #include<stdio.h>
2 #include<string.h>
3 #define N 101
4
5 int main()
6 {
7 int ncases, i, sum1, sum2;
8 int len1, len2, j;
9 char a[N], b[N];
10
11 while(scanf("%d",&ncases) != EOF)
12 {
13 for (i=1; i<=ncases; i++)
14 {
15 scanf("%s%s",a,b);
16 len1 = strlen(a);
17 len2 = strlen(b);
18 sum1 = 0;
19 sum2 = 0;
20 printf("Case %d: ",i);
21 for(j=0; j<len1; j++)
22 {
23 a[j] = a[j]-'0';
24 sum1 = sum1 + a[j];
25 }
26 for(j=0; j<len2; j++)
27 {
28 b[j] = b[j]-'0';
29 sum2 = sum2 + b[j];
30 }
31 printf("%d\n",sum1+sum2);
32 }
33 }
34 return 0;
35 }