#include
int main()
{int y,m,d,a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
do{printf("Please enter a date(yyyy m d):");
scanf("%d%d%d",&y,&m,&d);
}while(y<1||m<棚仿哗1||m>12||d<大凳1||d>链行a[m]+(m==2)&(y%4==0&&y%100>0||y%400==0));
printf("%d-%d-%d is a valid date!\n",y,m,d);
return 0;
}