Task

Determine whether a given year is a leap year in the Gregorian calendar.



See also

 Leap year (wiki)


sub isleap {
    my $year = shift;
    if ($year % 100 == 0) {
        return ($year % 400 == 0);
    }
    return ($year % 4 == 0);
}