当前位置:网站首页>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);
}
边栏推荐
- 本地makefile 编译其他文件夹文件 指定obj目录
- 单表查询、添加、更新与删除数据
- Learning non posture gaze deviation with head movement
- [force buckle] realize stack with queue
- ACWing每日一题.3511
- LeetCode树
- 【力扣】环形链表 II
- Common serial communication UART seen from pictures
- 通过VOR深度估计解决三维注视交互中的目标模糊问题
- Bottom up and top-down attention: different processes and overlapping nervous systems 2014sci
猜你喜欢
![Vscode instant English translation plug-in [translation (English Chinese Dictionary)]](/img/f4/9bd90910fef061b423ea8309fab439.png)
Vscode instant English translation plug-in [translation (English Chinese Dictionary)]

面试复习第N次

Simple chrome script automatically skips the charging acknowledgment page after the video playback of station B ends

Configure the 'log' shortcut key in vscode and remove the console log(‘‘); Semicolon in;

浅谈跨域的几种解决方案

2022/07/12 学习笔记 (day05)循环

Interview review nth time

你的企业最适合哪种深度学习?

2022/07/09 第五小组 丁帅 学习笔记 day02

Bottom up and top-down attention: different processes and overlapping nervous systems 2014sci
随机推荐
计算几何(4.17)
[usaco06dec]the fewest coins g (hybrid backpack)
2022/07/09 第五小组 丁帅 学习笔记 day02
Salgaze: personalized gaze estimation using visual saliency
Cable TV network (tree grouping)
Qtss constant
QT creator flashback solution
Acwing第57场周赛(AK)
filezilla传输虚拟机速度慢解决方法
Solutions to slow transmission speed of FileZilla virtual machine
Introduction to Darwin streaming server
Computational geometry (2)
2022/07/10 第五小组 丁帅 学习笔记 day03
busybox date 时间的加减
2022/07/12 learning notes (day05) cycle
LeetCode树
Make menuconfig missing ncurses
[force buckle] realize stack with queue
谷歌浏览器不能手动修改cookies,cookie报红标红
MEX and Increments