当前位置:网站首页>Date (day 76)
Date (day 76)
2022-07-25 06:02:00 【Zhangxueheng】
List of articles
1: subject
It's today 2012 year 4 month 12 Thursday, Sunday , Programming , Enter from today to 12 month 31 Any date between days , What day of the week is the output day .
Input format
There are two lines , The first line contains an integer m, Indicates the month of the inquiry date .
The second line contains an integer d, The date of inquiry is the day of the month .
Output format
The date of the output query is the day of the week .
Be careful , In English .
The English expression of Monday to Sunday is as follows :
"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"
Data range
4≤m≤12,
1≤d≤31,
Guarantee that the date is legal .
sample input :
5
20
sample output :
Sunday
2: Code implementation
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
const int months[] = {
0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
};
int main()
{
int month, date;
cin >> month >> date;
int m = 4, d = 12, day = 4;
while (m < month || d < date)
{
d ++ ;
if (d > months[m])
{
d = 1;
m ++ ;
}
day = (day + 1) % 7;
}
string names[] = {
"Sunday", "Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"
};
cout << names[day] << endl;
return 0;
}
边栏推荐
猜你喜欢

How to play a data mining game entry Edition
![(16) [system call] track system call (3 rings)](/img/b0/011351361135fd9f8e2d0d31749f73.png)
(16) [system call] track system call (3 rings)
![(15) [driver development] over written copy](/img/1c/68dfff5671add1fe91567e4df34135.png)
(15) [driver development] over written copy

基于ISO13209(OTX)实现EOL下线序列

Softing pngate series gateway: integrate PROFIBUS bus into PROFINET network

Unity model simplification / consolidation one click plug-in

HTB-Beep

求求你别再用 System.currentTimeMillis() 统计代码耗时了,真的太 Low 了!

QT qtextedit setting qscrollbar style sheet does not take effect solution

10、渲染基础
随机推荐
ECS is exclusive to old users, and the new purchase of the remaining 10 instances is as low as 3.6% off
Dynamic planning learning notes
50 places are limited to open | with the news of oceanbase's annual press conference coming!
HTB-Granpa
ROI pooling and ROI align
Talk about how redis handles requests
Why is it that all the games are pseudorandom and can't make true random?
Matlab drawing example: 5: Biaxial graph
出于数据安全考虑,荷兰教育部要求学校暂停使用 Chrome 浏览器
Common methods of JS operation array
(2022 Niuke multi School II) l-link with level editor I (dynamic planning)
Design of automatic machine dot drawing script based on C language
leetcode/整数除法
ERA5数据集说明
Unity Animator动画与状态机
Unity 模型简化/合并 一键式插件
VO, dto, do, Po distinction and use
(2022年牛客多校一)I-Chiitoitsu(期望DP)
Programming hodgepodge (II)
(牛客多校二)G-Link with Monotonic Subsequence(构造题)