#include<stdio.h>
#include<string.h> int main() {
char ch1[], ch2[];
int num1[], num2[];
int i, j, max, n, k, flag = ;
scanf("%d", &n);
for (k = ; k<n; k++) {
scanf("%s", ch1);
scanf("%s", ch2);
max = strlen(ch1);
if (max<strlen(ch2))
max = strlen(ch2);
for (i = ; i <= max; i++) {
num1[i] = ;
num2[i] = ;
}
for (i = strlen(ch1) - , j = ; i >= ; i--) {
num1[j++] = ch1[i] - '';
}
for (i = strlen(ch2) - , j = ; i >= ; i--) {
num2[j++] = ch2[i] - '';
}
for (i = ; i <= max; i++) {
num1[i] += num2[i];
if (num1[i]>) {
num1[i] -= ;
num1[i + ]++;
}
}
printf("Case %d:\n%s + %s = ", k + , ch1, ch2);
for (i = max - ; i >= ; i--) {
if (num1[i] == && flag == )
continue;
flag = ; printf("%d", num1[i]);
}
if (k != n - )
printf("\n\n");
else
printf("\n");
}
return ;
}
05-11 20:01