Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:错了。。不知道为什么?In Reply To:错了。。不知道为什么? Posted by:ACM05001_dz0302 at 2005-07-25 14:26:11 这个意思. void main() { int i,j,k,mp,np,tp,m[40],n[40],t[80]; char ch; for(i=0;i<80;i++) t[i]=0; for(i=0;i<41;i++) { scanf("%c",&ch); if(ch<'0'||ch>'9') break; m[i]=ch-'0'; } mp=i; for(i=0;i<mp/2;i++) { k=m[i]; m[i]=m[mp-i-1]; m[mp-i-1]=k; } for(i=0;i<41;i++) { scanf("%c",&ch); if(ch<'0'||ch>'9') break; n[i]=ch-'0'; } np=i; for(i=0;i<np/2;i++) { k=n[i]; n[i]=n[np-i-1]; n[np-i-1]=k; } for(i=0;i<mp;i++) for(j=0;j<np;j++) { t[i+j]=t[i+j]+m[i]*n[j]; t[i+j+1]=t[i+j+1]+t[i+j]/10; t[i+j]=t[i+j]%10; } tp=t[mp+np-1]==0?mp+np-2:mp+np-1; for(i=tp;i>=0;i--) printf("%d",t[i]); } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator