#include using namespace std; int main() { long long 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" << endl; return 0; }
本OJ不对外开放
本题库为可达信奥编程题库,仅对内部学员开放。
内部学员请联系班主任开通题库账号。
使用您的 可达信奥 通用账户