当前位置:网站首页>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;
}
边栏推荐
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 16
- A doctor's 22 years in Huawei
- 如何精准识别主数据?
- "Hands on learning in depth" Chapter 2 - preparatory knowledge_ 2.5 automatic differentiation_ Learning thinking and exercise answers
- 【无标题】数据库中一条查询SQL执行的过程
- Redis delete policy
- JS events (add, delete) and delegates
- CobaltStrike-4.4-K8修改版安装使用教程
- ReferenceError: primordials is not defined错误解决
- Number conclusion LC skimming review - 1
猜你喜欢

Sword finger offer 30 Stack containing min function

Master data management theory and Practice
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 6](/img/38/51797fcdb57159b48d0e0a72eeb580.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 6

Introduction to robotframework (III) Baidu search of webui automation

Pat grade a 1033 to fill or not to fill
![[matlab] access of variables and files](/img/cf/6f3cfdc4310fcf0bdcaa776d68261e.jpg)
[matlab] access of variables and files

Initial understanding of pointer variables

PMP每日一练 | 考试不迷路-7.5

PMP practice once a day | don't get lost in the exam -7.5

高数_向量代数_单位向量_向量与坐标轴的夹角
随机推荐
[Digital IC manual tearing code] Verilog asynchronous reset synchronous release | topic | principle | design | simulation
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
ftp上传文件时出现 550 Permission denied,不是用户权限问题
Gifcam v7.0 minimalist GIF animation recording tool Chinese single file version
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 7
Redis delete policy
729. My schedule I / offer II 106 Bipartite graph
2020.02.11
从顶会论文看2022年推荐系统序列建模的趋势
Force buckle 146 LRU cache
Maturity of master data management (MDM)
Pure QT version of Chinese chess: realize two-man, man-machine and network games
Redis cluster deployment based on redis5
PAT甲级 1033 To Fill or Not to Fill
故障分析 | MySQL 耗尽主机内存一例分析
Network Security Learning - Web vulnerabilities (Part 1)
MySQL (IV) - transactions
Building the prototype of library functions -- refer to the manual of wildfire
Redis installation
Referenceerror: primordials is not defined error resolution