| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 79042 | 杜奕辰 | 角谷猜想 | C++ | Time Limit Exceeded | 1000 MS | 268 KB | 342 | 2024-06-29 20:32:37 |
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; if(n==1) { cout<<"End"; } else { while(n!=1) { if(n%2==1) { cout<<n<<"*3+1="; cout<<n*3+1<<endl; n=n*3+1; }else if(n%2==0) { cout<<n<<"/2="; cout<<n/2<<endl; n=n/2; } } cout<<"End"; } return 0; }