Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
46339 | 张俊杰 | 角谷猜想 | C++ | Accepted | 7 MS | 268 KB | 336 | 2023-04-15 20:50:17 |
#include<iostream> using namespace std; int main() { long 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/=2; } } cout<<"End"<<endl; return 0; }