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 |
帮我看看哪错了?为什么会是超时呢,不应该有死循环啊. 大侠们帮帮看看哪错了? #include<iostream.h> void main() { int a[100],b,c,i,temp,n; i=0; cin>>a[i]; while(a[i]) { i++; cin>>a[i]; } n=i; for(i=0;i<n;i++) { c=a[i]; do { if(!(c/10)){b=c;break;} b=c/10+c%10; c=b; }while(a[i]%b); cout<<b<<endl; } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator