当前位置:网站首页>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

边栏推荐
- 2022 China eye Expo, Shandong vision prevention and control exhibition, myopia, China myopia correction Exhibition
- There are so many giants, why should we independently develop POS store cashier system?
- [eight part essay] what is the difference between unrepeatable reading and unreal reading?
- 一位博士在华为的22年
- Apicloud openframe realizes the transfer and return of parameters to the previous page - basic improvement
- RDD partition rules of spark
- Bigder: I felt good about the 34/100 interview, but I didn't receive the admission
- Visualstudio2019 compilation configuration lastools-v2.0.0 under win10 system
- SQL statement
- Crawler (9) - scrape framework (1) | scrape asynchronous web crawler framework
猜你喜欢

Use the list component to realize the drop-down list and address list

MySQL index

Computer graduation design PHP part-time recruitment management system for College Students

SPI communication protocol

Using SA token to solve websocket handshake authentication

Advanced technology management - what is the physical, mental and mental strength of managers
![Grabbing and sorting out external articles -- status bar [4]](/img/1e/2d44f36339ac796618cd571aca5556.png)
Grabbing and sorting out external articles -- status bar [4]

PAT甲级 1033 To Fill or Not to Fill

好用的 JS 脚本

爬虫(9) - Scrapy框架(1) | Scrapy 异步网络爬虫框架
随机推荐
Adapter-a technology of adaptive pre training continuous learning
[postgraduate entrance examination English] prepare for 2023, learn list5 words
Structural theme model (I) STM package workflow
HDU_ p1237_ Simple calculator_ stack
ftp上传文件时出现 550 Permission denied,不是用户权限问题
Multiple solutions to one problem, asp Net core application startup initialization n schemes [Part 1]
How does redis implement multiple zones?
[depth first search notes] Abstract DFS
Audio and video engineer YUV and RGB detailed explanation
事故指标统计
How to generate rich text online
How to use C to copy files on UNIX- How can I copy a file on Unix using C?
729. My schedule I / offer II 106 Bipartite graph
Computer graduation design PHP college student human resources job recruitment network
Using SA token to solve websocket handshake authentication
【机器人手眼标定】eye in hand
Computer graduation design PHP campus restaurant online ordering system
Easy to use js script
Formatting occurs twice when vs code is saved
Shell脚本更新存储过程到数据库
