/* function1 */
int pdrn(int str[])
{
int f1=0;
if(str[0]%4==0&&str[0]%100!=0||str[0]%400==0)
f1=1;
return f1;
}
/* function2 */
int pdyf(int str[])
{
int flag;
for(;str[1]<1||str[1]>12;)
{
printf("Month error! please input a data to month again: /a");
scanf("%d",&str[1]);
}
flag=pdrn(str);
if(flag&&str[1]==2)
for(;str[2]<=0||str[2]>=30;)
{
printf("WARING!/nDate error, %dyear is leap year, so days can't big than 29./n",str[0]);
printf("Input a data to month: /a");
scanf("%d",&str[2]);
}
else if(str[1]==2&&!flag)
for(;str[2]<=0||str[2]>=29;)
{
printf("WARING!/nDate error, %dyear isn't leap year, so days can't big than 28./n",str[0]);