Sha0_s1


私信TA

用户名:dotcpp0759241

访问量:1571

签 名:

关关难过关关过, 前路漫漫亦灿灿。

等  级
排  名 1804
经  验 2601
参赛次数 3
文章发表 48
年  龄 18
在职情况 学生
学  校 菜就多练
专  业 菜就多练

  自我简介:

菜就多练 菜就多练 菜就多练 菜就多练 菜就多练 菜就多练 菜就多练 菜就多练 菜就多练 菜就多练 菜就多练 菜就多练

TA的其他文章

无聊的星期六
浏览:14
#include <stdio.h>
typedef struct days {
    int  year;
    int  month;
    int  day;
}days;

int main()
{
    days today = {0};
    int sum = 0;
    scanf("%d %d %d", &today.year, &today.month, &today.day);
    int daysInMonth[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
    if (today.year % 400 == 0 || today.year % 4 == 0 && today.year % 100 != 0)daysInMonth[1] = 29;
    for (int i = 0; i < today.month - 1; i++) {
        sum += daysInMonth[i];
    }
    sum += today.day;
    printf("%d", sum);

    return 0;
}


 

0.0分

0 人评分

  评论区

  • «
  • »