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 |
Output limit exceed怎么解决?#include<stdio.h> 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; 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