#include <stdio.h>
int main(void)
{
int i, j, n, s, c, max, flag;
while (scanf("%d%d", &i, &j) == 2)
{
printf("%d %d ", i, j);
if (i > j)
n = j, j = i, i = n;
for (s = i, max = 1; s <= j; s++)
{
n = s;
c = 1;
while (n != 1)
{
if (n%2)
n = 3*n+1;
else
n /= 2;
c++;
}
if (c > max)
max = c;
}
printf("%d\n", max);
}
return 0;
}
沒有留言:
張貼留言