1. 程式人生 > >HDU-5978 To begin or not to begin

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;
}