#include <stdio.h>
void main()
{
int a[10],max,min,k;
int sum=0;
float score;
for (k=0;k<10;k++)
{
printf("Please input the score which is between 0 and 100:\n");
scanf ("%d",a[k]);
if (a[k]>100 || a[k]<0)
{
printf("ERROR!\n");
break;
}
}
for (k=0;k<10;k++)
{
max = a[k];
if (max < a[k])
{
max = a[k];
}
}
for (k=9;k>=0;k--)
{
min = a[k];
if (min > a[k])
{
min = a[k];
}
}
for (k=0;k<10;k++)
{
sum += a[k];
}
score = (sum-max-min) / 8.0;
printf("The final score is:%f\n",score);
}