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

为什么总是output limit exceed呢?????

Posted by 6382468 at 2005-01-11 12:44:44 on Problem 1207
#include<stdio.h>
#include<math.h>
void main(){
	long int i,j,k,count,max,t;
	scanf("%d%d",&i,&j);
	while(i>0&&j>0&&i<10000&&j<10000){
		max=0;
	    for(k=i;k<=j;k++){
		    count=1;
			t=k;
			while(t!=1){
				if(t%2==1) t=3*t+1;
			    else t=t/2;
			    count++;
			}
		    if(count>max) max=count;
		}
    printf("%d %d %d\n",i,j,max);
	scanf("%d%d",&i,&j);
	}
	
}

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