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 |
why总是output limit exceed???thanks!#include<iostream> using namespace std; int main() { int m,n,i,j,c1=1,c=1,k=1; for(k=1;;k++) { cin >>m >>n; int M=m; int N=m; int o=n-m; for(i=0;i<=o;i++) { for(j=1;;j++) { if(m==1) break; else if(m%2==1) m=1+3*m; else m=m/2; c1++; } if(c<=c1) c=c1; c1=1; M++; m=M; } cout <<N <<' '<<n <<' '<<c <<endl; c=1; } system("pause"); } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator