Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
39943 | teacher_lu | 角谷猜想 | C++ | Accepted | 1 MS | 252 KB | 356 | 2024-02-06 18:18:46 |
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; while(n != 1) { if(n%2==1) { 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; }