AC

哈基米已睡着 · 发布于 2025-08-12 · 浏览 366 回复 0

include <bits/stdc++.h>

using namespace std;

int main() {

int n, x;
cin >> n;
while (n != 1) {
	if (n % 2 == 0) {
		x = n;
		n = n / 2;
		cout << x << "/2" << "=" << n << endl;
	} else  {
		x = n;
		n = n * 3 + 1;
		cout << x << "*3+1" << "=" << n << endl;
	}
}

return 0;

}

全部回复 共 0 条

还没有人回复。往下写第一条。

发表回复