解题思路:
注意事项:
参考代码:
#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=2018, month=7, day=19, sum; //scanf("%d%d%d",&year,&month,&day); sum = 0; sum += a[month-1]+day+(isLeap(year) ? 1 : 0); printf("%d\n", sum); return 0; }
0.0分
0 人评分
倒杨辉三角形 (C语言代码)浏览:3892 |
2005年春浙江省计算机等级考试二级C 编程题(3) (C语言代码)浏览:388 |
C语言训练-求具有abcd=(ab+cd)2性质的四位数 (C语言代码)浏览:562 |
成绩转换 (C语言代码)浏览:1005 |
1009题解浏览:724 |
核桃的数量 (C语言代码)浏览:668 |
C语言程序设计教程(第三版)课后习题9.8 (C语言代码)浏览:608 |
模拟计算器 (C语言代码)浏览:2297 |
一元一次方程 (C语言代码)浏览:4059 |
C语言程序设计教程(第三版)课后习题12.2 (C语言代码)浏览:753 |