#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 人评分
printf基础练习2 (C语言代码)浏览:802 |
C语言训练-求矩阵的两对角线上的元素之和 (C++代码)浏览:845 |
C语言训练-求PI* (C语言代码)浏览:930 |
破解简单密码 (C语言代码)浏览:1866 |
C语言程序设计教程(第三版)课后习题6.7 (C语言代码)浏览:674 |
淘淘的名单 (C语言代码)答案错误???浏览:625 |
【出圈】 (C语言代码)浏览:824 |
WU-复数求和 (C++代码)浏览:2121 |
WU-整除问题 (C++代码)浏览:649 |
【绝对值排序】 (C语言代码)浏览:894 |