#include <iostream>
#include <cstdio>
using namespace std;
int cl(int n){
int c = 1;
while(1!=n){
if(n%2 == 0){
n/=2;
}else{
n=3*n+1;
}
c++;
}
return c;
}
int main(){
#ifndef ONLINE_JUDGE
freopen("in.txt","r",stdin);
freopen("out.txt","w",stdout);
#endif
int a,b,m,n;
while(2 == scanf("%d%d", &a, &b)){
m=0;
for(int i=a;i<=b;i++){
n=cl(i);
if(m<n) m=n;
}
printf("%d %d %d\n",a,b,m );
}
#ifndef ONLINE_JUDGE
fclose(stdin);
fclose(stdout);
#endif
}
poj 1207
最新推荐文章于 2021-04-26 22:41:22 发布