#include<stdio.h>

void main(void)

{

 int score,status,num=0,total=0;

 FILE *fp;

 

 fp=fopen("score.dat","r");

 if(fp==NULL)

    printf("Open Error\n");

 else

    {

     printf("Open Success\n");

     while(1)

        {

         status=fscanf(fp,"%d",&score);

         if(status==EOF)

            break;

         ++num;

         total+=score;

        }

     fclose(fp);

     printf("Average of score: %.1f\n",(float)total/(float)num);

    }

}