114514

枫原万叶  •  2个月前


include

using namespace std;

int main() {

long long int a, b = 0, sum = 0;
cin >> a;
while (a != 1) {
	if (a % 2 == 0) {//梦想变成猫娘(我是水印)
		sum++;
		a = a / 2;
	} else {
		sum++;
		a = a * 3 + 1;
	}
}
cout << sum;
return 0;

}


评论:

请先登录,才能进行评论