Advertisement
Guest User

Untitled

a guest
Jan 29th, 2020
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. bool is_leap(int year)
  2. {
  3.   bool divBy4=false, divBy100=false, divBy400=false;
  4.  
  5.   if (year%4==0) divBy4=true;
  6.   if (year%100==0) divBy100=true;
  7.   if (year%400==0) divBy400=true;
  8.  
  9.   if(divBy400==true) return true;
  10.   if(divBy4==true && divBy100==false) return true;
  11.   if(divBy100==false) return false;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement