Run ID:1116
提交时间:2023-07-10 15:28:49
#include<iostream> using namespace std; int a(int x){ if(x==1){ return 1; } else if(x%2==0){ cout<<x<<"/2="<<x/2<<endl; return a(x/2); } else { cout<<x<<"*3+1="<<x*3+1<<endl; return a(x*3+1); } } int main(){ int b; cin>>b; a(b); cout<<"End"; }