✅ rust: leap

This commit is contained in:
walkah committed 2020-08-20 21:54:50 -04:00
1 parent f48a042ef8
commit 55a3854cbd
5 files changed
+230

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
pub fn is_leap_year(year: u64) -> bool {
if year % 400 == 0 {
true
} else if year % 100 == 0 {
false
} else {
year % 4 == 0
}
}