文章

6

粉丝

0

获赞

9

访问

356

头像
打印日期 题解:
P1410 华中科技大学机试题
发布于2025年3月12日 20:17
阅读数 8

#include <iostream>
using namespace std;

int monthDays[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

bool isLeapYear(int year) {
    return (year % 400 == 0) || (year % 4 == 0 && year % 100 != 0);
}

int main() {
    int year, totalDays;
    while (cin >> year >> totalDays) {
        // 判断是否是闰年
        if (isLeapYear(year)) {
            monthDays[2] = 29;
        } else {
        &...

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发