Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
30348 | lmz120809 | 角谷猜想 | C++ | Accepted | 0 MS | 248 KB | 256 | 2023-11-07 20:26:27 |
#include<iostream> using namespace std; int main() { long n; cin>>n; while(n!=1){ if(n%2!=0){ cout<<n<<"*3+1="<<(n*3+1)<<endl; n=n*3+1; } else { cout<<n<<"/2="<<(n/2)<<endl; n=n/2; } } cout<<"End"; return 0; }