设:
\(p: 4\mid x\)
\(q: 100\mid x\)
\(r: 400\mid x\)
易知答案为
\[p\and\neg(q\and\neg r) \]从而
#include <bits/stdc++.h>
using namespace std;
int main()
{
int x;
scanf("%d", &x);
int p, q, r;
p = (x % 4 == 0);
q = (x % 100 == 0);
r = (x % 400 == 0);
printf("%d", p&&(!(q&&!r)));
return 0;
}