当前位置:网站首页>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);
}
边栏推荐
- Learning video saliency from human gaze using candidate selection
- Decorate Apple Tree
- 你见过的最差的程序员是怎样的?
- uboot 编译前的配置命令make config分析
- 【力扣】单值二叉树
- 谷歌浏览器不能手动修改cookies,cookie报红标红
- Markdown syntax and common shortcuts
- 2022/07/12 学习笔记 (day05)JS内置函数
- Ehab the xorcist (XOR property, construction)
- MySQL workbench basically uses [create a database]
猜你喜欢

2021-11-17 esp32 pin reference

有线电视网(树上分组)

Eye tracking in virtual reality

2022/07/10 group 5 Ding Shuai's study notes day03

2022/07/14 learning notes (day07) array

虚拟现实中的眼睛跟踪

Positional Change of the Eyeball During Eye Movements: Evidence of Translatory Movement眼球运动过程中眼球的位
![[force buckle] design cycle queue](/img/77/f1da62b302eaf16a271512527b096f.png)
[force buckle] design cycle queue

Creation and implementation of WebService interface

【力扣】对称二叉树
随机推荐
[force buckle] ring list II
Where have all the older programmers gone?
[detailed tutorial installation] [configuration] auxiliary plug-ins about eslint in vscode
Volatile function of embedded C language
Eye tracking in virtual reality
【力扣】用栈实现队列
虚拟现实中的眼睛跟踪
EOG based eye movement detection and gaze estimation for an asynchronous virtual keyboard
What's the worst programmer you've ever seen?
QT creator flashback solution
Qt Creator闪退解决办法
ACWing每日一题.3511
日常的眼睛接触检测使用无监督的注视目标发现
2022/07/11 group 5 Ding Shuai's study notes day04
你见过的最差的程序员是怎样的?
Cours de mathématiques de base 2 Fonction Euler, écran linéaire, élargissement de l'Europe
浅谈跨域的几种解决方案
[BJOI2019] 排兵布阵(分组背包)
实习笔试解答
计算几何(2)