判断年份大于0、月份大于0小于13、日期大于0小于等于月份对应的天数为正确输入,否则为错误输入。代码如下:include "stdio.h"int main(int argc,char *argv[]){ int y,m,d,md[12]={31,28,31,30,31,30,31,31,30,31,30,31};//md是每月天数数组 printf("Please enter the year, m...
typedef struct Date { int year;int month;int day;}Date;int checkDate(Date date){ int flag=1;...
int year,month,day;sscanf(str,"%d-%d-%d",&year,&month,&day);//自己调试下就好了
{ int year;int month;int day;}Date;int checkDate(Date date){ int flag=1;if(date.year>=1900...