MCPcopy Create free account
hub / github.com/Vishruth-S/CompetitiveCode / main

Function main

Hackerrank_problems/Day_Of_The_Programmer/solution2.cpp:13–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11*/
12
13int main() {
14 int year;
15 cin >> year;
16 if (year == 1918) { // transition
17 cout << "26.09.1918\n";
18 }
19 else { // gregorian and/or julian
20 if ((year < 1918 && year % 4 == 0) || (year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {
21 cout << "12.09." << year << '\n';
22 }
23 else {
24 cout << "13.09." << year << '\n';
25 }
26 }
27
28 return 0;
29}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected