Files
Toy/scripts/leapyear.toy

20 lines
248 B
Plaintext

//find the leap years
fn isLeapYear(n: int) {
if (n % 400 == 0) return true;
if (n % 100 == 0) return false;
return n % 4 == 0;
}
//check for string reuse
{
print isLeapYear(1999);
}
{
print isLeapYear(2000);
}
{
print isLeapYear(2004);
}