如题,代码如下:
#include <bits\stdc++.h> using namespace std; int n; int main() { cin >> n; while (true) { while (true) { if (n % 2 == 0) n /= 2; else n = (3 * n) + 1; break; } cout << n << endl; } return 0; }
先别管题目是神马,调了一天了/dk