#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 人评分
【求帮助】C语言程序设计教程(第三版)课后习题8.9 (C语言代码)浏览:845 |
C语言程序设计教程(第三版)课后习题10.7 (C语言代码)浏览:678 |
C语言考试练习题_排列 (C++代码)浏览:706 |
C语言训练-求1+2!+3!+...+N!的和 (C语言代码)浏览:2485 |
C语言程序设计教程(第三版)课后习题7.5 (C语言代码)浏览:663 |
C语言程序设计教程(第三版)课后习题6.3 (C语言代码)浏览:544 |
数组输出 (C语言代码)--此题的题目描述有问题浏览:1832 |
WU-格式化数据输出 (C++代码)浏览:1298 |
wu-理财计划 (C++代码)浏览:893 |
C语言考试练习题_保留字母 (C语言代码)浏览:735 |