Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
31537 | lnx | 角谷猜想 | C++ | Accepted | 0 MS | 252 KB | 272 | 2023-11-19 15:08:29 |
#include<iostream> using namespace std; int main() { int n; cin>>n; while(n!=1) { if(n%2==1) { cout<<n<<"*3+1="; n=3*n+1; cout<<n<<endl; } else { cout<<n<<"/2="; n=n/2; cout<<n<<endl; } } cout<<"End"; return 0; }