-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathday_of_programmer
42 lines (33 loc) · 917 Bytes
/
day_of_programmer
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
From 1700 to 1917, Russia's official calendar was the Julian calendar; since they used the Gregorian calendar
system. The transition from the Julian to Gregorian calendar system occurred in 1918,when the next day after January
31st was February 14th. This means that in 1918, February 14th was the 32nd day of the year in Russia.
*/
#include <iostream>
#include <cstring>
#include <bits/stdc++.h>
using namespace std;
int main(){
int y;
cin >> y;
if(y>=1919){
if(y%400==0 || (y%4==0 and y%100 !=0)){
cout<<"12.09."<<to_string(y);
}
else{
cout<<"13.09."<<to_string(y);
}
}
else if(y<=1917){
if(y%4==0){
cout<<"12.09."<<to_string(y);
}
else{
cout<<"13.09."<<to_string(y);
}
}
if(y==1918){
cout<<"26.09.1918";
}
return 0;
}