#include <stdio.h>
#include <stdbool.h>
int the_days_of_month(int month, int year);
bool is_leap(int year);
int main(void)
{
printf( "这个月有%d天\n",the_days_of_month(2,2022));
}
int the_days_of_month(int month, int year) {
int the_month[12] = { 31,is_leap( year)?29:28,31,30,31,30,31,31,30,31,30,31};
return the_month[month-1];
}
bool is_leap(int year) {
if (year%4==0)
return true;
else
return false;
}