mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-08 12:58:48 +00:00
751. 数组的左方区域
https://www.acwing.com/problem/content/submission/code_detail/6943206/
This commit is contained in:
parent
d8a111de8e
commit
70ab02ef3c
23
AcWing/751/751.cpp
Normal file
23
AcWing/751/751.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
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 > j && i + j < 11) sum += x;
|
||||
}
|
||||
}
|
||||
|
||||
if (op == 'S')
|
||||
printf("%.1lf", sum);
|
||||
else
|
||||
printf("%.1lf", sum / 30);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user