Run ID Author Problem Lang Verdict Time Memory Code Length Submit Time
89353 bnu_fanmeijie 角谷猜想 C++ Accepted 1 MS 252 KB 532 2026-06-02 15:40:34

Tests(1/1):


#include <iostream> using namespace std; int main() { int n; cin >> n; while (n != 1) { if (n % 2 == 0) { // 偶数:除以2 cout << n << "/2=" << n / 2 << endl; n = n / 2; // 更新n为新值 } else { // 奇数:乘3加1 cout << n << "*3+1=" << n * 3 + 1 << endl; n = n * 3 + 1; // 更新n为新值 } } cout << "End" << endl; // 注意:小写 end! return 0; }


Judgement Protocol: