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 |
改为while(scanf(....)!=-1)In Reply To:Re:Output limit exceed怎么解决?程序拷错了,应该是这个 Posted by:C0400204068 at 2004-03-03 21:16:16 读不到数据的时候,返回是-1,不是0 > int main() > { > int a,b,r,s,t,x; > while ( scanf("%d%d",&a,&b)!=0) > { > s=0; > for(r=a;r<=b;r++) > { > x=r,t=1; > while(x!=1) > { > if(x%2==0) x=x/2; > else x=3*x+1; > t++; > } > if(s<t) s=t; > } > printf("%d %d %d\n",a,b,s); > } > return 0; > } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator