#include <iostream>
#include <stdio.h>
#include <cstring>
using namespace std;
int main(){
int y,m,d;
int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int n;
scanf("%d",&n);
while(n--!=0){
scanf("%d-%d-%d",&y,&m,&d);
if((y%4==0&&y%100!=0)||y%400==0){a[2]=29;}
if(y<0||m<1||m>12||d<1||d>a[m]){
cout<<"NO"<<endl;
}
else{
cout<<"YES"<<endl;
}
a[2]=28;
}
return 0;
}
C++日期判断
最新推荐文章于 2022-12-08 09:03:51 发布