double sum; double average;
for(int i =0;i<12;i++) { for(int j =0;j<12;j++) { if(j<i&&i+j<11) sum += a[i][j]; } } if(c=='S') { printf("%.1lf",sum); }else if(c=='M'){ printf("%.1lf",sum/30); } //j<i&&i+j<11