怎么实现高精度乘法?
RT,是不是用字符串来保存,举个例子吧?
2010-11-01 19:27

2010-11-01 19:29
2010-11-01 20:14
程序代码:#include<stdio.h>
#define N 3
int main(){
int a[3] = {2,3,4}, b[3]={4,5,5}, c[2*N]={0};
int i, j, temp;
for (i=2; i>=0; i--)
{
for (j=2; j>=0; j--)
{
c[2*N-1-(N-1-i+N-1-j)]=a[i]*b[j]+c[2*N-1-(N-1-i+N-1-j)];
}
}
for (i=2*N-1; i>0; i--)
{
temp = c[i]/10;
c[i] = c[i]%10;
c[i-1] = c[i-1]+temp;
}
for (i=0; i<2*N; i++)
{
printf("%d",c[i]);
}
return 0;
}
2010-11-01 20:22
2010-11-02 12:28
2010-11-02 12:32
2010-11-03 11:00
2010-11-03 21:15
2010-11-05 09:07
反正我是看不懂的
2010-11-05 16:28