#include <bits/stdc++.h> using namespace std;
int main() { int N; cin >> N; while (N != 1) { if (N % 2 == 0) { cout << N << "/2=" << N / 2 << endl; N /= 2;
} else { cout << N << "*3+1=" << N * 3 + 1 << endl; N = N * 3 + 1; } } cout << "End"; return 0;
}
使用您的 蒙青创OJ 通用账户