解题思路:
注意事项:
参考代码:
#include <cstdio> #include <cstdlib> #include <iostream> #include <cmath> #include <cctype> #include <cstring> #include <string> #include <stack> #include <algorithm> #include <functional> using namespace std; int isLeap(int year) { return year%4==0 && year%100!=0 || year%400==0; } int a[12]={0,31,59,90,120,151,181,212,243,273,304,334}; int main() { int year, month, day, sum; while(scanf("%d/%d/%d", &year, &month, &day) == 3) { sum = 0; sum += a[month-1]+day+(isLeap(year) ? 1 : 0); printf("%d\n", sum); } return 0; }
0.0分
0 人评分
C语言考试练习题_排列 (C++代码)浏览:713 |
C语言程序设计教程(第三版)课后习题7.5 (C语言代码)浏览:670 |
C语言程序设计教程(第三版)课后习题10.5 (C语言代码)浏览:1484 |
C语言训练-计算t=1+1/2+1/3+...+1/n (C语言代码)浏览:910 |
简单的a+b (C语言代码)浏览:752 |
C语言训练-求1+2!+3!+...+N!的和 (C语言代码)浏览:822 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:512 |
Wu-求圆的面积 (C++代码)浏览:1994 |
DNA (C语言描述,蓝桥杯)浏览:1653 |
1126题解浏览:649 |