HDU-5978 To begin or not to begin

找规律,k为奇数输出0,k为偶数输出1

#include <iostream>
using namespace std;
int main () {
    int k;
    while (cin >> k) {
        if (k&1) cout << 0 << "\n";
        else cout << 1 << "\n";
    }
    return 0;
}

猜你喜欢

转载自blog.csdn.net/wl16wzl/article/details/82927544