//
/*
==================================================================
Title: Tryouts often use this method to find players score, remove a maximum score, remove a
Minimum score. Ask for average results!
Please implement this method of calculation programmatically.
==================================================================
*/
#include <stdio.h>
Main ()
{
float A[10],max,min,sum=0.0,aver;
int i;
printf ("Input score: \ n");
for (i=0;i<10;i++)
{
printf ("Score%2d:", i+1);
scanf ("%f", &a[i]);
if ((a[i]<0) | | | (A[I]>10))
{
printf ("The score was entered incorrectly. , make sure the score is at 0-10. \n______________________________\n ");
I=-1;
}
}
MAX=A[0];MIN=A[0];
for (i=0;i<10;i++)
{
if (Max<a[i])
Max=a[i];
if (Min>a[i])
Min=a[i];
Sum=sum+a[i];
}
Aver= (sum-max-min)/8;
printf ("Remove a highest score:%.1f\n", Max);
printf ("Remove a minimum score:%.1f\n", Min);
printf ("Average score is:%.2f\n", aver);
}
/*
==================================================================
Comment: Define the number of judges (10). Enter score (number of a[]), Max and Min, sum
Sum Ask sum-highest score-lowest score, average.
==================================================================
*/
Basic algorithm of C language 08-remove the highest score and remove the minimum score for averaging