提交时间:2023-08-10 12:58:56
运行 ID: 24297
#include<iostream> using namespace std; int main(){ int n,a=0; cin>>n; while(a!=1){ if(n%2==0){ a=n/2; cout<<n<<"/2="<<a<<endl; }else{ a=n*3+1; cout<<n<<"*3+1="<<a<<endl; } n=a; } cout<<"End"; return 0; }