|
|
|
|
|
by SamBam
846 days ago
|
|
I mean, that contradiction is also in the first two rules. It's a leap year if it's divisible by 4, but not if it's divisible by 100, so what about 200? Best to describe it as a flowchart * Is the year divisible by 400? YES -> Leap year * NO -> Is the year divisible by 100? YES -> Not leap year * NO -> Is the year divisible by 4? YES -> Leap year * NO -> Not leap year |
|
* Is the year divisible by 4? NO -> not leap year
* YES -> Is the year divisible by 100? NO -> leap year
* YES -> Is the year divisible by 400? NO -> not leap year
* YES -> leap year
This way you do only 1 division for 75% of years.