题目中有 (4) 个数字,但是 (c) 和 (d) 似乎并没有什么用……
首先,我们把每个月的天数存入数组中,因为题目中给了我们年份—— (2019),因此 (2) 月是 (28)天。
接着,如何判断是不是最后一天呢?只需要看 (b) 是不是那个月的总天数就可以了。
最后,不难写出代码:
#include <iostream>
#include <cstdio>
#include <cmath>
int month[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int main()
{
int a, b;
scanf("%d%d", &a, &b);
if (month[a] == b)puts("1");
else puts("0");
}