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

边栏推荐
- Paper notes: graph neural network gat
- 【社区人物志】专访马龙伟:轮子不好用,那就自己造!
- [depth first search notes] Abstract DFS
- Global and Chinese market of wheelchair climbing machines 2022-2028: Research Report on technology, participants, trends, market size and share
- 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
- HDU_p1237_简单计算器_stack
- [robot hand eye calibration] eye in hand
- [untitled] a query SQL execution process in the database
- 【coppeliasim】6自由度路径规划
- I like Takeshi Kitano's words very much: although it's hard, I will still choose that kind of hot life
猜你喜欢

Adapter-a technology of adaptive pre training continuous learning

vs code保存时 出现两次格式化

Know MySQL database

Audio and video engineer YUV and RGB detailed explanation

Building the prototype of library functions -- refer to the manual of wildfire

剑指 Offer 30. 包含min函数的栈
![[Clickhouse] Clickhouse based massive data interactive OLAP analysis scenario practice](/img/3a/63f3e89ddf84f23f950ed9620b4405.jpg)
[Clickhouse] Clickhouse based massive data interactive OLAP analysis scenario practice

RDD partition rules of spark

2022年版图解网络PDF

PHP campus financial management system for computer graduation design
随机推荐
ftp上传文件时出现 550 Permission denied,不是用户权限问题
Zero basic self-study STM32 wildfire review of GPIO use absolute address to operate GPIO
Use the list component to realize the drop-down list and address list
Crawler (9) - scrape framework (1) | scrape asynchronous web crawler framework
论文笔记: 图神经网络 GAT
模板_求排列逆序对_基于归并排序
I like Takeshi Kitano's words very much: although it's hard, I will still choose that kind of hot life
更改对象属性的方法
从顶会论文看2022年推荐系统序列建模的趋势
Multi function event recorder of the 5th National Games of the Blue Bridge Cup
Computer graduation design PHP part-time recruitment management system for College Students
After changing the GCC version, make[1] appears in the compilation: cc: command not found
2020.02.11
Bigder: I felt good about the 34/100 interview, but I didn't receive the admission
[depth first search notes] Abstract DFS
Bigder:34/100 面试感觉挺好的,没有收到录取
Y a - t - il des cas où sqlcdc surveille plusieurs tables et les associe à une autre? Tout fonctionne dans MySQL
Sword finger offer 30 Stack containing min function
【机器人手眼标定】eye in hand
This time, thoroughly understand the deep copy
