万能的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;
}

 

相关文章:

  • 2021-08-19
  • 2022-12-23
  • 2021-12-26
  • 2021-07-25
  • 2022-01-05
  • 2022-02-08
  • 2021-09-09
  • 2021-08-07
猜你喜欢
  • 2022-01-12
  • 2021-07-12
  • 2021-11-22
  • 2021-10-01
  • 2021-07-25
  • 2022-12-23
  • 2021-08-15
相关资源
相似解决方案