add sources
This commit is contained in:
parent
fcd25eea52
commit
7ce631a648
21 changed files with 548 additions and 2 deletions
|
@ -0,0 +1,16 @@
|
|||
import std.stdio;
|
||||
|
||||
pure bool leapYear(uint y)
|
||||
{
|
||||
return (y % 4) == 0 && (y % 100 || (y % 400) == 0);
|
||||
}
|
||||
|
||||
pure uint daysInYear(uint y)
|
||||
{
|
||||
return 365 + leapYear(y);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
writeln(daysInYear(2022));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue