解题思路:
注意事项:
参考代码:
#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语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:534 |
C语言程序设计教程(第三版)课后习题8.1 (Java代码)浏览:782 |
C语言训练-排序问题<2> (C++代码)浏览:886 |
用筛法求之N内的素数。 (C语言代码)浏览:1261 |
C语言程序设计教程(第三版)课后习题7.5 (C语言代码)浏览:524 |
printf基础练习2 (有点不明白)浏览:845 |
WU-图形输出 (C++代码)浏览:802 |
WU-拆分位数 (C++代码)浏览:787 |
输入输出格式练习 (C语言代码)浏览:753 |
拆分位数 (C语言代码)浏览:522 |