当前位置:网站首页>c语言 指定日期开始多少天 显示
c语言 指定日期开始多少天 显示
2022-07-17 05:12: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);
}
边栏推荐
- RestAPI实现聚合(黑马教程)
- Minio installation, deployment and simple use
- 0-10V,4-20mA电流电压转PWM隔离转换器 质料以及应用电路图
- Vscode configuring golang development environment
- 2021-11-10 micropyton TB6600步进驱动类
- Darwin分析经验
- Thermal resistance PT100 cu50 isolation converter to 4-20mA analog output temperature transmitter 0-10V
- sd nand与nandflash的区别?
- 国产化FPGA/DSP/ZYNQ方案要分析的几点
- 2021 - 09 - 15
猜你喜欢

Unable to determine Electron version. Please specify an Electron version

Material and application circuit diagram of 0-10V, 4-20mA current voltage to PWM isolation converter

Antd is not defined

索引库中的文档的操作

Dac7512n analog mixed signal IC converter

2021-09-15

【CS创世】 SD NAND和Raw NAND优劣势对比分析

HM8203线性两串充电管理控制器IC

3.7V lithium battery boost to 5v1a, fs2114 boost conversion chip design layout

Fs5383a lithium battery 3.7V input power supply solar lawn lamp drive IC
随机推荐
RestAPI实现自动补全 & 案例实现(搜索框输入进行自动补全)
HM9922开关降压型 LED恒流驱动器IC
mapping索引属性 & 创建索的操作
3.7V lithium battery boost to 5v1a, fs2114 boost conversion chip design layout
MCU单片机OTP
Rs-485/232 to 4-20ma/0-10v isolated d/a converter
Complete scheme diagram of lth7 five pin chip fs4054 charging circuit principle
Analog signal in-depth discussion on the transmission distance of 4-20mA current signal
DSL实现Metrics 聚合
FMC子卡:4 路 SFP+万兆光纤网络 FMC 子卡
什么是tSD/qSD?CS创世 SD NAND到底是什么?
隔离4-20mA或0-20mA信号传输
Lithium battery charging management chip
Fs4061a (5V USB input, double lithium battery series application, 5V boost charging, 8.4v Management IC
基于复旦微 FPGA+华为海思 HI3531DV200+兆易创新MCU 的综合视频处理卡
Unable to determine Electron version. Please specify an Electron version
简单Chrome脚本 自动跳过b站视频播放结束后的的充电鸣谢页面
2021-09-15
QTSS常数
升高压模块隔离模块HRA2460D-2W