Skip to content

Commit

Permalink
ABC365A Leap Year
Browse files Browse the repository at this point in the history
  • Loading branch information
Vicfred committed Aug 5, 2024
1 parent efd2630 commit 3d971a6
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions atcoder/abc365a_leap_year.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Vicfred
// https://atcoder.jp/contests/abc365/tasks/abc365_a
// implementation
#include <iostream>

using namespace std;

int main() {
int Y;
cin >> Y;
if(Y % 4 != 0) {
cout << 365 << endl;
} else if(Y % 4 == 0 and Y % 100 != 0) {
cout << 366 << endl;
} else if(Y % 100 == 0 and Y % 400 != 0) {
cout << 365 << endl;
} else if (Y % 400 == 0) {
cout << 366 << endl;
}
return 0;
}

0 comments on commit 3d971a6

Please sign in to comment.