#include<stdio.h>
#include<math.h>
int main(void)
{
int score[3][2][10] = {{{85, 90, 75, 30, 58, 60, 100, 45, 70, 48}, {75, 65, 75, 30, 50, 65, 50, 55, 40, -1}},
{{65, 95, 95, 35, 58, 62, 90, 40, -1, -1},{80, 90, 70, 30, 60, 60, 35, 60, 100, 55}},
{{80, 70, 75, 60, 58, 88, 70, -1, -1, -1},{10, 90, 80, 30, 45, 32, 65, 90, 70, -1}}};
int total3 = 0;
int total4 = 0;
int number3 = 0;
double average3, average4, rms;
int i, j, k;
for(i = 0 ; i < 3 ; ++i){
for(j = 0 ; j < 2 ; ++j){
for(k = 0 ; k < 10 ; ++k){
if(score[i][j][k] != -1){
total3 += score[i][j][k];
total4 += pow(score[i][j][k], 2);
++number3;
}
}
}
}
average3 = (double)total3/(double)number3;
printf("average = %5.1f\n", average3);
average4 = (double)total4/(double)number3;
rms = sqrt(average4 - pow(average3, 2));
printf("rms = %5.1f\n", rms);
return 0;
}