Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
128708 | 林扬皓bylz | 整数猜想 | C++ | 通过 | 100 | 0 MS | 248 KB | 233 | 2024-01-26 09:00:49 |
#include<bits/stdc++.h> using namespace std ; int main() { int n; cin>>n; cout<<n<<" "; while (n>1) { if (n%2==0) { n=n/2; cout<<n<<" "; } else { n=n*3+1; cout<<n<<" "; } } return 0; }