#include<bits/stdc++.h> using namespace std; int main () { int n; cin>>n; while(n!=1) { if (n%2==0) { n=n/2; cout<<n*2<<"/2="<<n<<endl; } else { n=n*3+1; cout<<(n-1)/3<<"*3+1="<<n<<endl; } } cout<<"End"; return 0; }
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; while(n!=1) { if(n%2==0) { n=n/2; cout<<n*2<<"/2="<<n<<endl; } else { n=n*3+1; cout<<(n-1)/3<<"*3+1="<<n<<endl; } } cout<<"End"; return 0; }
1+1=0
Using your lizikid universal account