当前位置:网站首页>CSP date calculation
CSP date calculation
2022-07-06 02:39:00 【< WRM>】
#include<bits/stdc++.h>
using namespace std;
bool yJudge(int y) {
if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {
return true;
}
return false;
}
int m1[12] = {
31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; // Leap year
int m2[12] = {
31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int main() {
int y, d;
scanf("%d%d", &y, &d);
int flag = 0;
int t = d;
int mongth, date;
if (yJudge(y)) {
for (int i = 0; i < 12&&t>0; i++) {
t = t - m1[i];
mongth = i + 1;
date = t + m1[i];
}
} else {
for (int i = 0; i < 12&&t>0; i++) {
t = t - m2[i];
mongth = i + 1;
date = t + m2[i];
}
}
printf("%d\n%d",mongth,date);
return 0;
}
边栏推荐
- RobotFramework入门(二)appUI自动化之app启动
- Day 50 - install vsftpd on ceontos6.8
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 9
- Sword finger offer 30 Stack containing min function
- A copy can also produce flowers
- Large scale DDoS attacks take Myanmar offline
- Httprunnermanager installation (III) - configuring myql Database & initialization data under Linux
- 解决:AttributeError: ‘str‘ object has no attribute ‘decode‘
- 怎么检查GBase 8c数据库中的锁信息?
- "Hands on learning in depth" Chapter 2 - preparatory knowledge_ 2.3 linear algebra_ Learning thinking and exercise answers
猜你喜欢

Master data management theory and Practice

剑指 Offer 29. 顺时针打印矩阵
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 14](/img/c5/dde92f887e8e73d7db869fcddc107f.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 14

好用的 JS 脚本

Looking at the trend of sequence modeling of recommended systems in 2022 from the top paper
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 8](/img/16/33f5623625ba817e6e022b5cb7ff5d.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 8
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 13](/img/29/49da279efed22706545929157788f0.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 13

构建库函数的雏形——参照野火的手册

2022 China eye Expo, Shandong vision prevention and control exhibition, myopia, China myopia correction Exhibition
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 12](/img/b1/926d9b3d7ce9c5104f3e81974eef07.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 12
随机推荐
力扣今日题-729. 我的日程安排表 I
Ue4- how to make a simple TPS role (II) - realize the basic movement of the role
729. My schedule I / offer II 106 Bipartite graph
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 13
HttpRunnerManager安装(三)-Linux下配置myql数据库&初始化数据
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 8
淘宝焦点图布局实战
Y a - t - il des cas où sqlcdc surveille plusieurs tables et les associe à une autre? Tout fonctionne dans MySQL
Redis cluster deployment based on redis5
剑指 Offer 29. 顺时针打印矩阵
米家、涂鸦、Hilink、智汀等生态哪家强?5大主流智能品牌分析
A copy can also produce flowers
There are so many giants, why should we independently develop POS store cashier system?
Déduisez la question d'aujourd'hui - 729. Mon emploi du temps I
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 11
HDU_ p1237_ Simple calculator_ stack
Gifcam v7.0 minimalist GIF animation recording tool Chinese single file version
爬虫(9) - Scrapy框架(1) | Scrapy 异步网络爬虫框架
I changed the driver to 5.1.35, but it is still the same error. I can succeed even now, but I will report this every time I do an SQL operation
Reset nodejs of the system