当前位置:网站首页>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
边栏推荐
- Concept of storage engine
- 【coppeliasim】高效传送带
- Overview of spark RDD
- 事故指标统计
- Minecraft 1.18.1, 1.18.2 module development 22 Sniper rifle
- 零基础自学STM32-复习篇2——使用结构体封装GPIO寄存器
- [community personas] exclusive interview with Ma Longwei: the wheel is not easy to use, so make it yourself!
- 2022年版图解网络PDF
- 2020.02.11
- How to generate rich text online
猜你喜欢
Social networking website for college students based on computer graduation design PHP
Pangolin Library: subgraph
【机器人库】 awesome-robotics-libraries
Prepare for the autumn face-to-face test questions
Use image components to slide through photo albums and mobile phone photo album pages
SPI communication protocol
0211 embedded C language learning
PHP campus movie website system for computer graduation design
Httprunnermanager installation (III) - configuring myql Database & initialization data under Linux
RDD conversion operator of spark
随机推荐
[Wu Enda machine learning] week5 programming assignment EX4 - neural network learning
怎么检查GBase 8c数据库中的锁信息?
2022 edition illustrated network pdf
How to check the lock information in gbase 8C database?
Data preparation
Template_ Quick sort_ Double pointer
HttpRunnerManager安装(三)-Linux下配置myql数据库&初始化数据
Overview of spark RDD
Online reservation system of sports venues based on PHP
Paper notes: limit multi label learning galaxc (temporarily stored, not finished)
Advanced technology management - what is the physical, mental and mental strength of managers
论文笔记: 图神经网络 GAT
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
RDD creation method of spark
Computer graduation design PHP college student human resources job recruitment network
Y a - t - il des cas où sqlcdc surveille plusieurs tables et les associe à une autre? Tout fonctionne dans MySQL
General process of machine learning training and parameter optimization (discussion)
机器学习训练与参数优化的一般过程 (讨论)
Lecture 4 of Data Engineering Series: sample engineering of data centric AI
I like Takeshi Kitano's words very much: although it's hard, I will still choose that kind of hot life