6c055a0435
As a whole, this is still tentative.
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);
|
|
}
|