#include <stdio.h>
int main()
{
int y, m = 0;
int arr[] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };
while (scanf_s("%d %d", &y, &m) == 2)
{
int day = arr[m];
if ((m == 2) && ((y % 4 == 0) && (y % 100 != 0) || (y % 400 == 0)))
{
day++;
}
printf("%d", day);
}
return 0;
}
逻辑或操作符要和判断相同条件的逻辑与操作符在一个括号里面否则导致其他条件无效