| ||||||||||
| 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 | |||||||||
Re:Output limit exceed怎么解决?程序拷错了,应该是这个In Reply To:Output limit exceed怎么解决? Posted by:C0400204068 at 2004-03-03 21:01:25 > #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;
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