当前位置:网站首页>Calculate the day of the year and implement it in C language
Calculate the day of the year and implement it in C language
2022-04-21 12:47:00 【Da Jinye】
Calculate the day of the year ,C Language implementation
#include <stdio.h>
int isleap(int year)
{
int leap;
leap = (year % 4 == 0 && year % 100 != 0 || year % 400 == 0);
return leap;
}
int fun(int year, int month, int day)
{
int table[13] = {
0,31,28,31,30,31,30,31,31,30,31,30,31 };
int days = 0, i;
for ( i = 1; i < month; i++)
{
days = days + table[i];
}
days = days + day;
if (isleap(year)&&month>2)
{
days = days + 1;
return days;
}
}
main()
{
int year, month, day, days;
printf(" Please enter year 、 month 、 Japan :");
scanf_s("%d%d%d", &year, &day, &days);
days = fun(year, month, day);
printf("%d year %d month %d Day is the... Of the year %d God \n", year, month, day, days);
}
Code
“ I'm the bigger stone in the river
Divide the tears into two equal parts
A flowing father
A flowing mother .”
Hidden Fairy Abandon thousands of buildings , The dust returns to the end of the world .
Smoke curled up , Floating clouds and rising clouds .
The bamboo fence is short , Lying drunk in the sunset .
Startled by the bright moon shadow , Carry a pot and return home .
Tread lightly on the grass , Take another look at the fallen flowers .
It's hard to tell what you like , Say what you want .
Later, he wrote many poems and some words ,
Idle days float and live extravagant thoughts , Steal the play of quefenglin garden .
Keep talking and laughing , I don't know why .
first , first , Eyes full of willows and Orioles swallow .
版权声明
本文为[Da Jinye]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204211246389472.html
边栏推荐
- Berkeley, Samsung | a fast post training converter pruning framework
- 软件工程期末试题及答案
- CPT 102_LEC 10
- 分享几款我在高频使用的 Chrome 浏览器插件,每一个都好用到飞起
- 2022年初级会计职称考试经济法基础练习题及答案
- [MySQL] extract and query JSON type field data
- AES automatically generates Base64 key encryption and decryption
- 实例:用C#.NET手把手教你做微信公众号开发(7)--普通消息处理之位置消息
- Simulated Login of selenium's slider verification code (pig Bajie website)
- selenium的滑块验证码的模拟登录(猪八戒网站)
猜你喜欢

What's the difference between you and the architect? How to improve

三、标签准备

2020 meituan (multithreading + redis)

CV技术指南免费版知识星球

斐波那契数列

Office Word 2016 中Word自带公式编辑器编辑的公式转Mathtype出现omml2mml.xsl 问题的解决方法

CVPR 2022 Oral|港中文开源PoseC3D:基于3D-CNN的骨骼动作识别框架

选择排序法

Daily AI frontier terminology: active learning

SKU中的销售属性值必须成对填写,那这是什么原因
随机推荐
制造业数字化转型存在哪些问题
Redis数据库集群(主从复制、哨兵、Cluster)
IEEE PR for paper | 202b
Go language reflection
实例:用C#.NET手把手教你做微信公众号开发(7)--普通消息处理之位置消息
How nodejs converts buffer data to string
Three. JS learning project -- 3D data visualization of anti US aggression and aid Korea
Event Analysis | sharing the runner up scheme of table tennis timing action positioning competition
构建QML应用程序
最长上升子序列(二)(贪心+二分)
36天突击腾讯终拿Offer! Redis、高并发
软件工程期末试题及答案
4 years of Android development 13K, completed this 1307 page Android interview full set of real problem analysis, job hopping and salary increase 15K
Repairing tables with SQL statements
打包的jar能正常运行,正常连接数据库。exe4j生成exe后执行到访问数据库就报错:
AES automatically generates Base64 key encryption and decryption
Binary tree traversal series 01 - recursive traversal and recursive order
Russian Foreign Ministry official: the special military operation in Ukraine will end after the security threat caused by NATO is eliminated
GSMA announced: 2022 MWC Shanghai postponed
第四章 SQL查询之-层次化查询