過不了,真的過不了#includeusing namespace std;int main(){int n;
while (cin >> n){int count = 0;while (n != 4){if (n % 2 == 0){n /= 2;}else{n = (n * 3 + 1)/2;count++;}count++;}cout << count << endl;}return 0;}
建表,io加速就能過了
過不了,真的過不了#includeusing namespace std;int main(){int n;
while (cin >> n){int count = 0;while (n != 4){if (n % 2 == 0){n /= 2;}else{n = (n * 3 + 1)/2;count++;}count++;}cout << count << endl;}return 0;}
建表,io加速就能過了
輸入輸出不要用cin cout,可以用printf scanf,如果用getchar_unlocked putchar_unlocked更快