From aba7f11c01da6c3b4fe30993e79f73ce7986b79d Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Thu, 5 Nov 2020 19:10:00 +0800 Subject: [PATCH] =?UTF-8?q?720.=20=E8=BF=9E=E7=BB=AD=E6=95=B4=E6=95=B0?= =?UTF-8?q?=E7=9B=B8=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://www.acwing.com/problem/content/submission/code_detail/2846068/ --- AcWing/720/720.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 AcWing/720/720.cpp diff --git a/AcWing/720/720.cpp b/AcWing/720/720.cpp new file mode 100644 index 00000000..84a40f48 --- /dev/null +++ b/AcWing/720/720.cpp @@ -0,0 +1,19 @@ +#include + +using namespace std; + +int a, n, ans; + +int main() { + cin >> a; + + while (cin >> n, n <= 0) {} + + for (int i = 0; i < n; i++) { + ans += i + a; + } + + cout << ans << endl; + + return 0; +}