From eb20579b2a68f8242142908c1b1d8029d8adb3a7 Mon Sep 17 00:00:00 2001 From: Ren Baoshuo Date: Tue, 3 Aug 2021 15:03:14 +0800 Subject: [PATCH] =?UTF-8?q?743.=20=E6=95=B0=E7=BB=84=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://www.acwing.com/problem/content/submission/code_detail/6863533/ --- AcWing/743/743.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 AcWing/743/743.cpp diff --git a/AcWing/743/743.cpp b/AcWing/743/743.cpp new file mode 100644 index 00000000..d0a20c94 --- /dev/null +++ b/AcWing/743/743.cpp @@ -0,0 +1,19 @@ +#include + +using namespace std; + +int main() { + int l; + cin >> l; + char op; + cin >> op; + double x, sum = 0; + for (int i = 0; i < 12; i++) { + for (int j = 0; j < 12; j++) { + cin >> x; + if (i == l) sum += x; + } + } + cout << fixed << setprecision(1) << sum / (op == 'S' ? 1 : 12) << endl; + return 0; +}