0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-23 21:48:48 +00:00

745. 数组的右上半部分

https://www.acwing.com/problem/content/submission/code_detail/6491122/
This commit is contained in:
Baoshuo Ren 2021-07-17 13:14:05 +08:00
parent 7b0bad68ac
commit 39b812e23c
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

20
AcWing/745/745.cpp Normal file
View File

@ -0,0 +1,20 @@
#include <bits/stdc++.h>
using namespace std;
int main() {
char c;
double sum = 0.00, t;
cin >> c;
for (int i = 0; i < 12; i++) {
for (int j = 0; j < 12; j++) {
cin >> t;
if (j > i) sum += t;
}
}
if (c == 'S')
cout << fixed << setprecision(1) << sum;
else
cout << fixed << setprecision(1) << sum / 66;
return 0;
}