当前位置:网站首页>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;
}
边栏推荐
- Crawler (9) - scrape framework (1) | scrape asynchronous web crawler framework
- 零基础自学STM32-复习篇2——使用结构体封装GPIO寄存器
- [matlab] access of variables and files
- Shell脚本更新存储过程到数据库
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 9
- 从顶会论文看2022年推荐系统序列建模的趋势
- 高数_向量代数_单位向量_向量与坐标轴的夹角
- 2022.02.13
- 米家、涂鸦、Hilink、智汀等生态哪家强?5大主流智能品牌分析
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 14
猜你喜欢
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 22](/img/e0/21367eeaeca10c0a2f2aab3a4fa1fb.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 22

2022 China eye Expo, Shandong vision prevention and control exhibition, myopia, China myopia correction Exhibition
![[Digital IC manual tearing code] Verilog asynchronous reset synchronous release | topic | principle | design | simulation](/img/e4/890e84ab8326e029c4915163904d85.jpg)
[Digital IC manual tearing code] Verilog asynchronous reset synchronous release | topic | principle | design | simulation

Reset nodejs of the system

Pure QT version of Chinese chess: realize two-man, man-machine and network games

How to accurately identify master data?

Httprunnermanager installation (III) - configuring myql Database & initialization data under Linux

Black high-end responsive website dream weaving template (adaptive mobile terminal)

Looking at the trend of sequence modeling of recommended systems in 2022 from the top paper

解决:AttributeError: ‘str‘ object has no attribute ‘decode‘
随机推荐
inherited constructors
Force buckle 146 LRU cache
SQL table name is passed as a parameter
LeetCode 103. Binary tree zigzag level order transverse - Binary Tree Series Question 5
米家、涂鸦、Hilink、智汀等生态哪家强?5大主流智能品牌分析
Master data management theory and Practice
HDU_p1237_简单计算器_stack
Easy to use js script
Introduction to robotframework (I) brief introduction and use
Keyword static
Qt发布exe软件及修改exe应用程序图标
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 18
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
DDoS attacks - are we really at war?
技术分享 | undo 太大了怎么办
MySQL winter vacation self-study 2022 11 (5)
会员积分营销系统操作的时候怎样提升消费者的积极性?
怎么检查GBase 8c数据库中的锁信息?
Redis cluster deployment based on redis5
Multiple solutions to one problem, asp Net core application startup initialization n schemes [Part 1]