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 |
for(;scanf("%d",&n);)----> while(scanf("%d", &n)!=EOF)In Reply To:这个程序为什么会超时啊? Posted by:pxwzzzz at 2006-12-27 12:54:05 > #include<stdio.h> > > int main(){ > int n,i,j; > > for(;scanf("%d",&n);){ > > if(n){ > i=1; > j=1; > while(i!=0){ > i=(i*10+1)%n; > j++; > } > printf("%d\n",j);} > else > return 1; > } > return 1; > } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator