| Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|
| 38866 | chenyifei | 角谷猜想 | C++ | Accepted | 1 MS | 260 KB | 290 | 2024-01-28 17:41:51 |
#include<iostream> using namespace std; int main() { int n; cin>>n; while(n!=1){ if(n%2==0){ int a=n/2; cout<<n<<"/2="<<a<<endl; n=n/2; } else if(n%2==1){ int b=n*3+1; cout<<n<<"*3+1="<<b<<endl; n=n*3+1; } } cout<<"End"<<endl; return 0; }