domybest100

July_week3_4)윤년(Leap Year)

Jul 17th, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.23 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4.     int y[] = { 4,100,400 };
  5.     int n, isL = 0;
  6.     cin >> n;
  7.     for (int i = 0; i < 3; i++) if (n%y[i] == 0) isL++;
  8.     (isL%2==0) ? puts("Not Leap Year") : puts("Leap Year");
  9.     return 0;
  10. }
Add Comment
Please, Sign In to add comment