解题思路:
注意事项:
参考代码:
//jgt #include<stdio.h> struct DAY { int year; int month; int day; }; int main() { struct DAY d; scanf("%d%d%d",&d.year,&d.month,&d.day); int days = 0,i; for(i = 1; i < d.month; i++) if(i==1||i==3||i==5||i==7||i==8||i==10||i==12) days+=31; else if(i == 2) { if(d.year%4==0&&d.year%100!=0||d.year%400==0) days+=29; else days+=28; } else days+=30; days+=d.day; printf("%d\n",days); return 0; }
0.0分
1 人评分
2004年秋浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:466 |
简单的a+b (C语言代码)浏览:530 |
2006年春浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:647 |
淘淘的名单 (C语言代码)浏览:1104 |
Wu-求圆的面积 (C++代码)浏览:1892 |
简单的a+b (C语言代码)浏览:528 |
C语言程序设计教程(第三版)课后习题5.8 (C语言代码)浏览:672 |
母牛的故事 (C语言代码)浏览:945 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:517 |
2003年秋浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:588 |