2_3.c
contents ::
  2_1.c
  2_2.c
  2_3.c

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

main(){
  int judge1[10], judge2[10],judge3[10],i=0,j,n;
  double s1,s2,s3,total1=0,total2=0,total3=0;
  double sq_dist1=0, sq_dist2=0, sq_dist3=0;
  double mean1=0, mean2=0, mean3=0;
  double std_dev1=0, std_dev2=0, std_dev3=0;

  /* loops until scanf returns End Of File... */
  while(scanf("%d%lg%lg%lg",&n,&s1,&s2,&s3)!=EOF){

    // place each of scores into appropriate array
    
    judge1[i]=s1;
    judge2[i]=s2;
    judge3[i++]=s3;
    
  }

  /* Calculate the mean of each judge */
  for(j=0; j<i; j++){
    // add the totals
    total1+=judge1[j];
    total2+=judge2[j];
    total3+=judge3[j];
  }
  // then calculate the averages
  mean1=total1/i;
  mean2=total2/i;
  mean3=total3/i;

  /* Calculate the SD of each judge */
  for(j=0; j<i; j++){
    // calculate distance from average
    sq_dist1+=pow(judge1[j]-mean1,2);
    sq_dist2+=pow(judge2[j]-mean2,2);
    sq_dist3+=pow(judge3[j]-mean3,2);
  }
  std_dev1=sqrt(sq_dist1/(i-1));
  std_dev2=sqrt(sq_dist2/(i-1));
  std_dev3=sqrt(sq_dist3/(i-1));

  printf("\t\tAverage\tSD\n");
  printf("Judge 1 :\t%.1f\t%.1f\n",mean1,std_dev1);
  printf("Judge 2 :\t%.1f\t%.1f\n",mean2,std_dev2);
  printf("Judge 3 :\t%.1f\t%.1f\n",mean3,std_dev3);
  return 0;
}

James Little