#include <cstdio>
using namespace std;
int main()
{
int n;
#ifndef ONLINE_JUDGE
freopen("e:\\uva_in.txt", "r", stdin);
#endif
while (scanf("%d", &n) == 1)
{
if (n == 0)
break;
int cnt = 0;
while (n != 1) {
if (n & 1)
n = 3 * n + 1;
n /= 2;
cnt++;
}
printf("%d\n", cnt);
}
return 0;
}
题目1031:xxx定律
最新推荐文章于 2022-02-13 10:37:08 发布