Advertisement
dllbridge

Untitled

Mar 26th, 2025
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.63 KB | None | 0 0
  1.        
  2.        
  3.        
  4. #include <iostream>
  5. using namespace std;       
  6.        
  7. /////////////////////////////////////////////////
  8. int main()
  9. {
  10.    
  11.     int year = 2000;
  12.    
  13.     bool isLeapYear = 0;
  14.    
  15.     if(year%4 == 0)
  16.     {
  17.        
  18.       // cout << "step_1" << endl; 
  19.        
  20.        if(year%100 == 0)
  21.        {
  22.           if(year%400 == 0)
  23.           {
  24.                
  25.              isLeapYear = true;
  26.              cout << "True" << endl;   
  27.              return 0; 
  28.                
  29.           }
  30.          
  31.           isLeapYear = 0;      
  32.           cout << "False" << endl; 
  33.           return 0;
  34.        }
  35.        
  36.         isLeapYear = 1;
  37.         cout << "True" << endl;
  38.         return 0;  
  39.        
  40.     }
  41.    
  42.     isLeapYear = 0;    
  43.     cout << "False" << endl;   
  44.     return 0;  
  45. }
  46.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement