NOJ/35/main.c

20 lines
326 B
C
Raw Permalink Normal View History

2020-08-31 16:46:43 +00:00
#include <stdio.h>
#define TH(x) ((x)*(x))
int main(void){
int number,i;
double avg,temp[33000];
scanf("%d",&number);
for(i = 0 ;i < number; i++){
scanf("%lf",&temp[i]);
avg += temp[i];
}
avg /= number;
double s = 0.0;
for(i = 0; i < number; i++){
s += TH(temp[i] - avg);
}
printf("%.6lf\n",s);
return 0;
}