| Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|
| 83204 | fanziyan | 角谷猜想 | C++ | Accepted | 0 MS | 248 KB | 598 | 2026-01-24 22:28:19 |
#include <iostream> using namespace std; int main() { int n; cin >> n; if (n == 1) { cout << "End" << endl; return 0; } while (n != 1) { int current = n; int nest; if (current % 2 == 1) { nest = current * 3 + 1; cout << current << "*3+1=" << nest << endl; } else { nest = current / 2; cout << current << "/2=" << nest << endl; } n = nest; // 这一行必须放在while循环体内部! } cout << "End" << endl; return 0; }