csansoon

P1.15 P61634 Leap years

Sep 19th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. int main() {
  6.     int x;
  7.     cin >> x;
  8.     if ((x%100)==0) {
  9.         x=(x/100);
  10.         if ((x%4)==0) {cout << "YES" << endl;}
  11.         else {cout << "NO" << endl;}
  12.     }
  13.     else if ((x%4)==0) {
  14.         cout << "YES" << endl;
  15.     }
  16.     else {
  17.         cout << "NO" << endl;
  18.     }
  19. }
Add Comment
Please, Sign In to add comment