当前位置:网站首页>C language specifies how many days to display from the date
C language specifies how many days to display from the date
2022-07-19 06:27:00 【xp5xp6】
#include <stdio.h>
#include <stdlib.h>
const char buf_date[2][13]={
{
0,31,28,31,30,31,30,31,31,30,31,30,31},
{
0,31,29,31,30,31,30,31,31,30,31,30,31}};
static int leap_year(int year)
{
if((0 == year%4 && 0 != year%100) || 0 == year%400)
return 1;
else
return 0;
}
static int date_find(int year, int month, int day, int n)
{
int i, k, leap;
for (i = 0; i < n; i++, day++) {
leap = leap_year(year);
if (day > buf_date[leap][month]) {
printf("%04d %02d %02d full \n",year,month,day);
day = 1;
if(12 == month) {
month = 1;
year++;
} else
month++;
}
printf("---------%04d %02d %02d i %d\n",year,month,day, i);
}
return 0;
}
int main()
{
date_find(2015, 1, 1, 1000);
}
边栏推荐
- LeetCode字符串
- Acwing game 58 (AK)
- Single table query, add, update and delete data
- 谷歌浏览器不能手动修改cookies,cookie报红标红
- 【力扣】另一棵树的子树
- Peerless good problem (bit operation optimization DP)
- [force buckle] flip binary tree
- Decorate Apple Tree
- Quantum three body problem: an overview of numerical computation
- [Li Kou] a subtree of another tree
猜你喜欢

【力扣】对称二叉树
![[force buckle] flip binary tree](/img/9f/d0c5f624ae455c5c010f9a6df5df64.png)
[force buckle] flip binary tree

【力扣】用栈实现队列

用头部运动学习无姿态注视偏差
![[force buckle] ring list II](/img/12/9cbc7081e2f7a87e77faf0e02a8c26.png)
[force buckle] ring list II

Cable TV network (tree grouping)

2022/07/10 group 5 Ding Shuai's study notes day03
![[force buckle] bracket matching](/img/0d/8290cee0601c106e0ebbffb77d83ab.png)
[force buckle] bracket matching

What kind of deep learning is most suitable for your enterprise?

2022/07/12 learning notes (day05) cycle
随机推荐
[transfer] Darwin streaming server core code analysis
c语言调用文件浏览器,实现选择文件的效果
开源在线的MarkDown编辑器 --【Editor.md】
Eye tracking in virtual reality
XOR gun (bit operation, thinking, interval violence)
单表查询、添加、更新与删除数据
Busybox date date increases by one day, and decreases by one day on the Internet tomorrow
Salgaze: personalized gaze estimation using visual saliency
Learning non posture gaze deviation with head movement
Computational geometry (2)
【力扣】环形链表 II
Introduction to Darwin streaming server
[detailed tutorial installation] [configuration] auxiliary plug-ins about eslint in vscode
2022/07/11 第五小组 丁帅 学习笔记 day04
Résoudre le problème de l'ambiguïté de la cible dans l'interaction de fixation 3D par l'estimation de la profondeur vor
[force buckle] realize stack with queue
【力扣】括号匹配
计算几何(4.17)
嵌入式C语言重点(const、static、voliatile、位运算)
Internship written examination answers