AC

你好啊陌生人  •  1天前


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;

}


评论:

请先登录,才能进行评论