mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-20 01:04:08 +10:00
20 lines
248 B
Plaintext
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);
|
|
}
|