题目描述
还是一样没啥说的…大家加油!
算法1
(暴力枚举) $O(n^2)$
C++ 代码
#include<iostream>
using namespace std;
int main()
{
double a[12][12],s = 0;
char m;
cin >> m;
for (int i = 0 ; i < 12 ; ++ i)
for (int j = 0 ; j < 12 ; ++ j) scanf("%lf",&a[i][j]);
for (int i = 0 ; i < 12 ; ++ i)
for (int j = 0 ; j < i ; ++ j) s += a[i][j];
printf("%.1lf",m == 'S' ? s : s / 66.0);
return 0;
}