当前位置:网站首页>Blue Bridge Cup group B provincial preliminaries first question 2013 (Gauss Diary)
Blue Bridge Cup group B provincial preliminaries first question 2013 (Gauss Diary)
2022-07-06 02:25:00 【Professor】
Title : Gauss diary
Gauss, the great mathematician, has a good habit : Keep a diary anyway .
There is a difference in his diary , He never indicated the date of , It's a whole number instead of , such as :4210
Later people knew , That integer is the date , It says that day is the day after Gauss was born . Maybe it's a good habit , It reminds the master of : Another day passed , How much time can be wasted ?
Gauss was born in :1777 year 4 month 30 Japan .
In the diary of an important theorem discovered by Gauss, it says :5343, So we can figure out that it was :1791 year 12 month 15 Japan .
On the day Gauss got his doctorate, the diary read :8113
Please work out the date when Gauss got his doctorate .
The format for submitting the answer is :yyyy-mm-dd, for example :1980-03-21
Please follow the format strictly , Submit answers via browser .
Be careful : Just submit this date , Don't write anything else , such as : Explanatory text .
————————————————
#include<iostream>
using namespace std;
bool isLeapYear(int y)
{
return(y%4==0&&y%100!=0)||(y%400==0);// If it is a leap year, return 1, It's not a leap year return 0
}
int main()
{
int y=1777;
int m=4;
int d=30;
for(int i=0;i<8112;++i)// Remember to reduce the number of days 1, If the diary is 5343, Fill in here 5342, If the diary is 8113, Then fill in 8112
{
d++;
if(m==12&&d==32)// To 12 Month end initialization
{
y++;
m=1;
d=1;
continue;
}
if((m==1||m==3||m==5||m==7||m==8||m==10)&&d==32)// Initialize by the end of these months
{
m++;
d=1;
continue;
}
if((m==4||m==6||m==9|m==11)&&d==31)// Initialize by the end of these months
{
m++;
d=1;
continue;
}
if(m==2&&isLeapYear(y)&&d==30)// It's a leap year , return 1, Yes 29 God
{
m++;
d=1;
continue;
}
if(m==2&&!isLeapYear(y)&&d==29)// It's not a leap year return 0, Take instead 1, Yes 28 God
{
m++;
d=1;
continue;
}
}
cout<<y<<" "<<m<<" "<<d<<endl;
}
Here are some pictures , By year /4 Simply judge whether it is a leap year
边栏推荐
- Shell脚本更新存储过程到数据库
- 2022年版图解网络PDF
- 【clickhouse】ClickHouse Practice in EOI
- Exness: Mercedes Benz's profits exceed expectations, and it is predicted that there will be a supply chain shortage in 2022
- SSM assembly
- How to generate rich text online
- Reset nodejs of the system
- Minecraft 1.18.1、1.18.2模组开发 22.狙击枪(Sniper Rifle)
- 【coppeliasim】6自由度路径规划
- Know MySQL database
猜你喜欢
Zero basic self-study STM32 wildfire review of GPIO use absolute address to operate GPIO
【MySQL 15】Could not increase number of max_ open_ files to more than 10000 (request: 65535)
Keyword static
Paper notes: graph neural network gat
Spark accumulator
Initial understanding of pointer variables
Minecraft 1.16.5 生化8 模组 2.0版本 故事书+更多枪械
Audio and video engineer YUV and RGB detailed explanation
好用的 JS 脚本
Crawler (9) - scrape framework (1) | scrape asynchronous web crawler framework
随机推荐
UE4 - how to make a simple TPS role (I) - create a basic role
[depth first search] Ji Suan Ke: Betsy's trip
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
Using SA token to solve websocket handshake authentication
Method of changing object properties
Visualstudio2019 compilation configuration lastools-v2.0.0 under win10 system
Global and Chinese markets of nasal oxygen tubes 2022-2028: Research Report on technology, participants, trends, market size and share
数据准备工作
Template_ Quick sort_ Double pointer
Crawler (9) - scrape framework (1) | scrape asynchronous web crawler framework
Advanced technology management - what is the physical, mental and mental strength of managers
I like Takeshi Kitano's words very much: although it's hard, I will still choose that kind of hot life
High number_ Vector algebra_ Unit vector_ Angle between vector and coordinate axis
PAT甲级 1033 To Fill or Not to Fill
剑指 Offer 30. 包含min函数的栈
【无标题】数据库中一条查询SQL执行的过程
Have a look at this generation
Concept of storage engine
Overview of spark RDD
Template_ Find the reverse pair of permutations_ Sort based on merge