#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<iomanip>
#include<cmath>
using namespace std;
int main()
{
long long int n;
cin >> n;
long long int x = 0;
while (true)
{
if (n % 2 == 1)
{
n = n * 3 + 1;
}
else
{
n = n / 2;
}
x ++;
if (n == 1)
{
cout << x << endl;
break;
}
}
}
洛谷 P6206 [USACO06OCT] Another Cow Number Game G
最新推荐文章于 2024-10-08 20:32:22 发布