解题思路:
注意事项:
参考代码:
#include <stdio.h>
typedef struct date{
int year,month,day;
}D;
int main()
{
D d;
int total=0;
scanf("%d%d%d",&d.year,&d.month,&d.day);
total+=d.day;
switch(d.month-1){
case 11:total+=30;
case 10:total+=31;
case 9:total+=30;
case 8:total+=31;
case 7:total+=31;
case 6:total+=30;
case 5:total+=31;
case 4:total+=30;
case 3:total+=31;
case 2:total+=28;
case 1:total+=31;
}
if(d.year%400==0||d.year%4==0&&d.year%100!=0)
if(d.month>2)
total++;
printf("%d",total);
}
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题6.4 (C语言代码)浏览:674 |
十->二进制转换 (C语言代码)浏览:1330 |
C语言程序设计教程(第三版)课后习题5.8 (C语言代码)浏览:613 |
简单的a+b (C语言代码)浏览:564 |
A+B for Input-Output Practice (III) (C语言代码)浏览:592 |
C语言程序设计教程(第三版)课后习题8.6 (C语言代码)浏览:631 |
wu-理财计划 (C++代码)浏览:907 |
DNA (C语言描述,数据结构)浏览:909 |
C语言程序设计教程(第三版)课后习题10.3 (C语言代码)浏览:565 |
C语言考试练习题_保留字母 (C语言代码)浏览:743 |