~cpp
#include <stdio.h>
int cycle_length(int n); // cycle_length를 구는
void main()
{
int i_num, j_num; // 력되는 두
int max = 0; // 대값 0로 는다
scanf("%d %d", &i_num, &j_num); // 두 를 는다
for ( ;i_num<j_num;i_num++ ) // 두 cycle_length값
// 대값 구다
max = max<cycle_length(i_num)?cycle_length(i_num):max;
printf("%d\n", max); // 대값 력
}
int cycle_length(int n)
{
int count = 1; //
while ( n!=1 ) {
if ( n%2!=0 )
n = n*3+1;
else n /= 2;
count++;
}
return count;
}










