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

在我电脑上运行可以呀,为什么WA呢?

Posted by clearriver at 2006-08-01 14:28:08
#include<iostream.h>
int get(int x)
{int b;
b=x/10000+(x%10000)/1000+((x%1000)/100)+(x%100)/10+x%10;
if(b<10) return b;
else return get(b);
}
void main()
{
	 int i,a=1,c[100000];
	for(i=0;a!=0;i++)
	{cin>>c[i];
	a=c[i];
	if(a!=0) 
	cout<<get(c[i])<<endl;}
}



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