解题思路:
注意事项:
参考代码:
#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语言程序设计教程(第三版)课后习题10.1 (C语言代码)浏览:1448 |
川哥的吩咐 (C++代码)浏览:1016 |
C语言程序设计教程(第三版)课后习题9.3 (Java代码)浏览:966 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:560 |
用筛法求之N内的素数。 (C语言代码)浏览:1260 |
C语言程序设计教程(第三版)课后习题5.4 (C语言代码)浏览:1293 |
母牛的故事 (C语言代码)浏览:934 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:338 |
WU-链表数据求和操作 (C++代码)浏览:1316 |
Wu-求圆的面积 (C++代码)浏览:1892 |