笔记
#include <cstdio>
int main()
{
char t;
scanf("%c", &t);
double q[12][12];
for (int i = 0; i < 12; i ++ )
for (int j = 0; j < 12; j ++ )
scanf("%lf", &q[i][j]);
double s = 0, c = 0;
for (int j = 0; j < 5; j ++ )
for (int i = j + 1; i <= 10 - j; i ++ )
{
s += q[i][j];
c += 1;
}
if (t == 'S') printf("%.1lf\n", s);
else printf("%.1lf\n", s / c);
return 0;
}