解题思路:
注意事项:
参考代码:
#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 人评分
2006年春浙江省计算机等级考试二级C 编程题(2) (C++代码)直接打表啊8以上值不变hhh浏览:638 |
C二级辅导-求偶数和 (C语言代码)浏览:639 |
简单编码 (C++代码)(这里推荐用switch)浏览:962 |
母牛的故事 (C语言代码)浏览:671 |
C语言程序设计教程(第三版)课后习题5.8 (C语言代码)浏览:770 |
弟弟的作业 (C++代码)浏览:1304 |
C语言训练-求素数问题 (C语言代码)浏览:1458 |
【密码】 (C语言代码)浏览:333 |
不容易系列 (C语言代码)浏览:670 |
简单的a+b (C语言代码)浏览:695 |