#include<stdio.h>
int judgeleapyear(int y)
{
int lp = 0;
if (y%4==0 && y%100!=0 || y%400==0)
{
lp = 1;
}else
{
lp = 0;
}
return lp;
}
int judgedays(int y, int m)
{
int days = 0;
if (m==4 || m==6 || m==9 || m==11)
{
days = 30;
}else if (m==1 || m==3 || m==5 || m==7 || m==8 || m==10 || m==12)
{
days = 31;
}else if (judgeleapyear(y) == 1)
{
days = 29;
}else
{
days = 28;
}
return days;
}
int main(void)
{
int y = 0;
int m = 0;
printf(“Input year and month:\n”);
scanf(“%d%d”,&y,&m);
printf("%d\n",judgedays(y,m));
return 0;
}