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