```cpp
include[HTML_REMOVED]
include[HTML_REMOVED]
using namespace std;
double a[12][12];
int main(){
double sum=0;
char ch;
int c=0;
cin>>ch;//先输入字母
for(int i=0;i<12;i){
for(int j=0;j<12;j){
cin>>a[i][j];
}
}
for(int i=1;i<12;i){
for(int j=11;j>11-i;j–){
sum+=a[i][j];
c;
}
}
if(ch==’S’) printf(“%.1lf”,sum);
else if(ch==’M’) printf(“%.1lf”,sum/c);
return 0;
}