#include<stdio.h>
#include<math.h>
void main(){
long b,c,d;
int i,i1,i2,j,k,n,n1,n2,a[256];
char s1[256]={0},s2[256]={0};
printf(“大整数乘法计算:/n请输入乘数s1:/ns1 = “);
scanf(“%s”,&s1);
printf(“请输入乘数s2:/ns2 = “);
scanf(“%s”,&s2);
for (i=0;i<255;i++)
a[i]=0;
for(i=255;i>=0;i–)
{
if(s1[i]==0)
continue;
else
{
n1=i+1;
break;
}
}
printf(“s1的长度n1 = %d/n”,n1);
for(i=255;i>=0;i–){
if(s2[i]==0)
continue;
else
{
n2=i+1;
break;
}
}
printf(“s2的长度n2 = %d/n”,n2);
d=0;
for(i1=0,k=n1-1;i1<n1;i1++,k–)
{
for(i2=0,j=n2-1;i2<n2;i2++,j–)
{
i=i1+i2;
b=a[i]+(s1[k]-48)*(s2[j]-48)+d;
a[i]=b%10;
d=b/10;
}
while(d>0)
{
i=i+1;
a[i]=a[i]+d%10;
d=d/10;
}
n=i;
}
printf(“%s * %s = “,s1,s2);
for (i=n;i>=0;i–)
printf(“%d”,a[i]);
printf(“/n/n/n”);
}