From e5991ec511c4da23d998d1b4c9d00429f046373d Mon Sep 17 00:00:00 2001 From: Dmitry Kokorin Date: Mon, 7 Mar 2016 21:10:57 +0300 Subject: [PATCH] leap: iteration 1 --- cpp/leap/leap.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 cpp/leap/leap.h diff --git a/cpp/leap/leap.h b/cpp/leap/leap.h new file mode 100644 index 0000000..1e4e2f3 --- /dev/null +++ b/cpp/leap/leap.h @@ -0,0 +1,12 @@ +#pragma once + +#define EXERCISM_RUN_ALL_TESTS + +namespace leap { + +inline bool is_leap_year(int year) +{ + return !(year % 4) && ((year % 100) || !(year % 400)); +} + +}