萬能的discuss。只需要月份和天數同奇同偶即可,9月30和11月30例外
#include <iostream> #include <cstdio> using namespace std; int main() { //freopen("in.txt","r",stdin); int n; scanf("%d",&n); while(n--) { int year,month,day; scanf("%d%d%d",&year,&month,&day); if((month+day)%2==0 || (month==9 && day==30) || (month==11 && day==30)) printf("YES\n"); else printf("NO\n"); } return 0; }