题解
2025-04-10 15:29:33
发布于:江苏
10阅读
0回复
0点赞
#include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
cout<<n;
while(n!=1){
if(n%2==0){
n/=2;
}else{
n*=3;
n++;
}
cout<<"->"<<n;
}
return 0;
}
这里空空如也
有帮助,赞一个