Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

错了。。不知道为什么?

Posted by ACM05001_dz0302 at 2005-07-25 14:26:11 on Problem 2389
#include<stdio.h>
void main(){
	int m[41],n[41],r[81];
	int temp,k;
    int i=1,j=1,s,u;
	char t;
	for(s=1;s<81;s++)
		r[s]=0;
	while(1){
		scanf("%c",&t);
		if((int)t<'0'||(int)t>'9')
			break;
		m[i++]=(int)t-'0';
	}
	for(temp=1;temp<=(int)(i-1)/2;temp++)
	{k=m[temp];m[temp]=m[i-temp];m[i-temp]=k;}
		while(1){
		scanf("%c",&t);
		if((int)t<'0'||(int)t>'9')
			break;
		n[j++]=(int)t-'0';
	}
		for(temp=1;temp<=(int)(j-1)/2;temp++)
	{k=n[temp];n[temp]=n[j-temp];n[j-temp]=k;}
for(s=1;s<j;s++)
for(u=1;u<i;u++)
{

	r[u+s-1]+=m[s]*n[u];
for(k=1;;k++)
	if((temp=r[u+s-1+k-1]/10)!=0)
	{r[u+s-1+k-1]=r[u+s-1+k-1]%10;
r[u+s-1+k-1+1]+=temp;
	}
	else break;
}
for(i=80;r[i]==0;i--){}
for(j=i;j>0;j--)
printf("%d",r[j]);
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator