1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
#include <iostream>
#include <map>
#include <iomanip>
#include <string>
#include <limits>
#include <sstream>
using namespace std;
//Declarations
string name, city;
char answer; //answer = y/n = process new diver?
int min, max, sum = 0;
int highest = numeric_limits<int>().min(), lowest = numeric_limits<int>().max(); //highest and lowest numbers for AVG.
int x = 0, i = 0, nwDvr = 0, dvNum = 0, ttlNum = 0; //x & i = counters; nwDvr = new Diver; diver number; total number of scores
float scr[5], score = 0.0, scrLp = 0.0; //Array (score0, score1, score2, score3, score4), score = counter, score of all loops
float difLvl = 0.0, scrAvg = 0.0, ttlAvg = 0.0; //difficulty level, score average, total avg score,
for (int i = 0; i < 5; ++i) {
int x;
cin >> x;
highest = max(highest, x);
lowest = min(lowest, x);
sum += x;
}
sum -= highest + lowest;
cout << sum / 3.0;
|