mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-08 13:58:48 +00:00
745. 数组的右上半部分
https://www.acwing.com/problem/content/submission/code_detail/6491122/
This commit is contained in:
parent
7b0bad68ac
commit
39b812e23c
20
AcWing/745/745.cpp
Normal file
20
AcWing/745/745.cpp
Normal 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;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user