From 58db81b52b935ffd2f526491920daf977dd0b550 Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Mon, 9 May 2022 17:20:01 +0800 Subject: [PATCH] =?UTF-8?q?714.=20=E8=BF=9E=E7=BB=AD=E5=A5=87=E6=95=B0?= =?UTF-8?q?=E7=9A=84=E5=92=8C=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://www.acwing.com/problem/content/submission/code_detail/14061154/ --- AcWing/714/714.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 AcWing/714/714.cpp diff --git a/AcWing/714/714.cpp b/AcWing/714/714.cpp new file mode 100644 index 00000000..43bf20ad --- /dev/null +++ b/AcWing/714/714.cpp @@ -0,0 +1,23 @@ +#include + +using std::cin; +using std::cout; +const char endl = '\n'; + +int x, y, ans; + +int main() { + std::ios::sync_with_stdio(false); + + cin >> x >> y; + + if (y < x) std::swap(x, y); + + for (int i = x + 1; i < y; i++) { + if (i & 1) ans += i; + } + + cout << ans << endl; + + return 0; +}