mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-08 15:18:46 +00:00
743. 数组中的行
https://www.acwing.com/problem/content/submission/code_detail/6863533/
This commit is contained in:
parent
ac5c9e19a0
commit
eb20579b2a
19
AcWing/743/743.cpp
Normal file
19
AcWing/743/743.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user