/* A + B Problem II
Problem description
I have a very simple problem for you. Given two integers A and B, your job is to calculate the sum of A + B.
Input
The first line of the input contains an integer T (1 <= T <= 20) which means the number of test cases. then T lines follow, each line consists of two positive integers, A and B. notice that the integers are very large, that means you shoshould not process them by using 32-bit integer. you may assume the length of each integer will not exceed 1000.
Output
For each test case, You shoshould output two lines. the first line is "case #:", # means the number of the test case. the second line is the an equation "A + B = sum", sum means the result of A + B. note there are some spaces int the equation. output a blank line between two test cases.
Sample Input
2
1 2
112233445566778899 998877665544332211
Sample output
Case 1:
1 + 2 = 3
Case 2:
112233445566778899 + 998877665544332211 = 1111111111111111110 */
/* Learn from the experience of the great gods and encourage new users.
*/
# Include <stdio. h>
# Include <string. h>
Int main ()
{
Int str1 [1100], str2 [1100];
Char A [1, 1100], B [2, 1100];
Int test, I, j, T, k = 1, len1, len2;
Scanf ("% d", & test );
Getchar ();
While (test --)
{
Char sum [1100] = {0 };
Scanf ("% S % s", a, B );
Getchar ();
Len1 = strlen ();
Len2 = strlen (B );
Memset (str1, 0, sizeof (str1 ));
Memset (str2, 0, sizeof (str2 ));
For (I = 0, j = len1-1; I <len1; I ++, j --)
Str1 [J] = A [I]-'0 ';
For (I = 0, j = len2-1; I <len2; I ++, j --)
Str2 [J] = B [I]-'0 ';
If (len1 <len2)
{
T = len2;
Len2 = len1;
Len1 = T;
}
For (I = 0; I <= len1; I ++)
{
Sum [I] = str1 [I] + str2 [I] + sum [I];
If (sum [I]/10> 0)
{
Sum [I + 1] = sum [I]/10;
Sum [I] = sum [I] % 10;
}
}
Printf ("case % d: \ n", k );
K ++;
Printf ("% S + % s =", a, B );
If (sum [len1]! = 0)
Printf ("% d", sum [len1]);
For (j = len1-1; j> = 0; j --)
Printf ("% d", sum [J]);
Printf ("\ n ");
If (test! = 0)
Printf ("\ n ");
}
While (1 );
Return 0;
}