解题思路:
注意事项:
参考代码:
#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++代码)浏览:2218 |
Tom数 (C语言代码)浏览:2011 |
点我有惊喜!你懂得!浏览:1978 |
C语言训练-求素数问题 (C语言代码)浏览:955 |
C语言程序设计教程(第三版)课后习题6.3 (C语言代码)浏览:510 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:677 |
C语言程序设计教程(第三版)课后习题7.2 (C语言代码)浏览:534 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:669 |
字符逆序 (C语言代码)浏览:638 |
1908题解浏览:638 |