上代码(*^▽^*)
#include<bits/stdc++.h> using namespace std; int main() { int i; cin>>i; if(i == 1){ cout<<"End"; }else{ while(1) { if(i % 2 == 0) { cout<<i<<"/2=";i = i / 2;cout<<i<<endl; }else{ cout<<i<<"*3+1=";i = i * 3 + 1;cout<<i<<endl; } if(i == 1) { break; } } } cout<<"End"; return 0; }