| ||||||||||
| 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 | |||||||||
在我电脑上运行可以呀,为什么WA呢?#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator