为啥错了啊!!!!!!

B2077 角谷猜想

yzm0325 @ 2023-07-21 14:23:08

#include <bits/stdc++.h>
using namespace std;
long long n;
int main() {
    cin >> n;
    while(n != 1) {
        if(!(n & 1)) {
            printf("%d/2=%d\n", n, n / 2);
            n /= 2;
        } else {
            printf("%d*3+1=%d\n", n, n * 3 + 1);
            n = n * 3 + 1;
        }
    }
    cout << "End";
    return 0;
}

Subtask1 全WA


by Sad_Rex @ 2023-07-21 14:28:05

@zym0325 printf改cout


by yzm0325 @ 2023-07-21 14:29:47

@lovely_Rex ou,应该用 %lld(第 n 次错了)


|