Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:Output limit exceed怎么解决?程序拷错了,应该是这个

Posted by C0400204068 at 2004-03-03 21:16:16 on Problem 1207
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator