当前位置:网站首页>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;
}
边栏推荐
- GifCam v7.0 极简GIF动画录制工具中文单文件版
- 主数据管理理论与实践
- 米家、涂鸦、Hilink、智汀等生态哪家强?5大主流智能品牌分析
- Redis installation
- Multiple solutions to one problem, asp Net core application startup initialization n schemes [Part 1]
- What should we pay attention to when using the built-in tool to check the health status in gbase 8C database?
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 24
- 会员积分营销系统操作的时候怎样提升消费者的积极性?
- 07 singleton mode
- Dachang image library
猜你喜欢

HttpRunnerManager安装(三)-Linux下配置myql数据库&初始化数据

一位博士在华为的22年

3D drawing ()
![[matlab] access of variables and files](/img/cf/6f3cfdc4310fcf0bdcaa776d68261e.jpg)
[matlab] access of variables and files
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 14](/img/c5/dde92f887e8e73d7db869fcddc107f.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 14

Sword finger offer 30 Stack containing min function

解决:AttributeError: ‘str‘ object has no attribute ‘decode‘

The third level of C language punch in
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 9](/img/ed/0edff23fbd3880bc6c9dabd31755ac.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 9

Gifcam v7.0 minimalist GIF animation recording tool Chinese single file version
随机推荐
解决:AttributeError: ‘str‘ object has no attribute ‘decode‘
07 singleton mode
Yyds dry inventory comparison of several database storage engines
Bigder:34/100 面试感觉挺好的,没有收到录取
Referenceerror: primordials is not defined error resolution
怎么检查GBase 8c数据库中的锁信息?
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 14
PAT甲级 1033 To Fill or Not to Fill
550 permission denied occurs when FTP uploads files, which is not a user permission problem
MySQL winter vacation self-study 2022 11 (7)
全国大学生信息安全赛创新实践赛初赛---misc(永恒的夜)
[Wu Enda machine learning] week5 programming assignment EX4 - neural network learning
[Digital IC manual tearing code] Verilog asynchronous reset synchronous release | topic | principle | design | simulation
Pat grade a 1033 to fill or not to fill
Solution: attributeerror: 'STR' object has no attribute 'decode‘
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 22
Is there a case where sqlcdc monitors multiple tables and then associates them to sink to another table? All operations in MySQL
2020.02.11
深度解析链动2+1模式,颠覆传统卖货思维?
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 13