提交时间:2024-02-08 13:42:14
运行 ID: 40206
#include<iostream> using namespace std; int main() { int n; cin>>n; while(n!=1){ cout<<n; if(n%2!=0){ cout<<"*3+1="; n*=3; n++; cout<<n; } else{ n/=2; cout<<"/2="<<n; } cout<<endl; } cout<<"End"; return 0; }