I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B.
A,B must be positive.
输入 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 should not process them by using 32-bit integer. You may assume the length of each integer will not exceed 1000. 输出 For each test case, you should 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. 样例输入 2 1 2 112233445566778899 998877665544332211 样例输出 Case 1: 1 + 2 = 3 Case 2: 112233445566778899 + 998877665544332211 = 1111111111111111110#include <stdio.h>#include <string.h>#define M 1005char a[M];char b[M];int main(){ int n,N; scanf("%d",&n); N=n; while(n--) { scanf("%s %s",a,b); int a_len=strlen(a)-1; int b_len=strlen(b)-1; int c[M]={0}; int carry=0,len=0; while(a_len>=0||b_len>=0) { if(a_len<0) a[a_len]='0'; if(b_len<0) b[b_len]='0'; int x=a[a_len--]-'0'; int y=b[b_len--]-'0'; int sum=x+y+carry; c[len++] = sum; carry=sum/10; } c[len]=carry; int p=0; for(int i=M-1;i>=0;i--) { if(c[i]>0) { p=i; break; } } printf("Case %d:\n",N-n); printf("%s + %s = ",a,b); for(int j=p;j>=0;j--) printf("%d",c[j]); printf("\n"); } return 0;}