#include <iostream> #include <iomanip> using namespace std; double a[8]; double max , min=0, sum=0; int i; void main () { cout<<fixed<<showpoint<<setprecision(2); cout<<"Enter the eight judges scores \n"; cin>>a[0]>>a[1]>>a[2]>>a[3]>>a[4]>>a[5]>>a[6]>>a[7]; max = a[0]; for (i=1 ; i<=7 ; i++) { if (a[i] > max) max = a [i]; else if (a[i] <= min) min = a [i]; } for (i=0 ; i<=7 ; i++) { if (a[i]==max || a[i]==min) a[i]=0; } for (i=0 ; i<=7 ; i++) { sum+= a[i]; } cout<<"The contestant recevies a total of "<<sum<<" points \n"; }
7mesho wrote:max = a[0];
max = min = a[0];
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)