#include "stdafx.h"
int count(int n)
{
static int cnt = 0;
if (n==1)
{
return cnt;
}
else if (n%2)
{
n = (3 * n + 1)/2;
++cnt;
count(n);
}
else
{
++cnt;
n /= 2;
count(n);
}
}
int _tmain(int argc, _TCHAR* argv[])
{
int n;
cin >> n;
cout << count(n) << endl;
return 0;
}
1001.3n+1猜想
最新推荐文章于 2023-08-09 10:40:21 发布