Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
1117 | 关清声 | 角谷猜想 | C++ | Accepted | 2 MS | 252 KB | 381 | 2023-07-10 15:29:08 |
#include<bits/stdc++.h> using namespace std; int find(long long x) { if(x==1) { cout<<"End"<<endl; return 1; } else { if(x%2==0) { cout<<x<<"/"<<2<<"="<<x/2<<endl; return find(x/2); } else { cout<<x<<"*"<<3<<"+"<<1<<"="<<x*3+1<<endl; return find(x*3+1); } } } int main() { long long x; cin>>x; find(x); return 0; }