0
点赞
收藏
分享

微信扫一扫

【无标题】打卡

钎探穗 2022-03-15 阅读 65

#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;
}

举报

相关推荐

《无标题》

【无标题】[][]

【无标题】无日

【无标题】填空

【无标题】1

【无标题】sss

【无标题】this指针

【无标题】rest

【无标题】额外

0 条评论