#include<iostream>
#include<stdio.h>
#include<math.h>
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a,b;
while(scanf("%d %d",&a,&b)!=EOF)
{
if(b==4 || b==6 ||b==9 ||b==11)
{
printf("30\n");
}else if(b==2)
{
if(a%4==0)
{
printf("29\n");
}else{
printf("28\n");
}
}else{
printf("31\n");
}
}
system("pause");
return 0;
}
因为一个月30天的月份就4,6,9,11这四个,所以拿来列举判断比较方便,然后判断月份是不是二月份,再用年份%4判断是不是闰年