- gf25055 的博客
《死亡笔记-题目讲义》抗击“桦加沙”台风假期赛第B题解
- @ 2025-9-24 14:23:23
#include <bits/stdc++.h>
using namespace std;
int main(){
int x,s=0;
cin>>x;
int t=x;
int N=0;
do{
if(N%10==3){
break;
}else{
if(t%2==0){
N+=t;
t=t/2;
s+=1;
}else{
N+=t;
t=3*t+1;
s+=1;
}
}
}while(true);
cout<<s;
return 0;
}