NOJ/82/main.c
Saturneric 52668c4122 Add.
2020-09-01 00:46:43 +08:00

20 lines
315 B
C

#include <stdio.h>
int main(void){
int i, j;
int k = i;
int max = 0;
scanf("%d %d",&i,&j);
for(;k <= j; k++){
int temp = k, count = 0;
while(temp != 1){
if(temp % 2) temp = 3 * temp + 1;
else temp /= 2;
count++;
}
if(count > max) max = count;
}
printf("%d %d %d\n",i,j,max+1);
return 0;
}