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