1 #include<stdio.h> 2 #include<string.h> 3 char s[1000]; 4 void mult(char a[],char b[]) 5 { 6 int i,j,k=0,alen,blen,sum=0,res[500][500]={0},flag=0; 7 char result[500]; 8 alen=strlen(a);blen=strlen(b); 9 10 for (i=0;i<alen;i++) 11 for (j=0;j<blen;j++) res[i][j]=(a[i]-'0')*(b[j]-'0'); 12 13 for (i=alen-1;i>=0;i--) 14 { 15 for (j=blen-1;j>=0;j--) sum=sum+res[i+blen-j-1][j]; 16 result[k]=sum; 17 k=k+1; 18 sum=sum/10; 19 } 20 21 for (i=blen-2;i>=0;i--) 22 { 23 for (j=0;j<=i;j++) sum=sum+res[i-j][j]; 24 result[k]=sum; 25 k=k+1; 26 sum=sum/10; 27 } 28 if (sum!=0) {result[k]=sum;k=k+1;} 29 30 for (i=0;i<k;i++) result[i]+='0'; 31 for (i=k-1;i>=0;i--) s[i]=result[k-1-i]; 32 s[k]='