```#include<stdio.h>
int main()
{
int year,month,day;
while(scanf("%d%d",&year,&month)!=EOF)
{
if(year%4==0&&year%100!=0||year%400==0)
{
if(month==2)
printf("29\n");
else if(month==1||month==3||month==5||month==7||month==8||month==10||month==12)
printf("31\n");
else
printf("30\n");
}
else
{
if(month==2)
printf("28\n");
else if(month==1||month==3||month==5||month==7||month==8||month==10||month==12)
printf("31\n");
else
printf("30\n");
}
}
}
简单粗暴,前后直接复制,所以代码看起来有点长度