|
|
@ -5,6 +5,12 @@ using namespace std;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void find_minmax(vector<double> numbers, double& min, double& max)
|
|
|
|
void find_minmax(vector<double> numbers, double& min, double& max)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (numbers.empty())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
min = max = 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
min = numbers[0];
|
|
|
|
min = numbers[0];
|
|
|
|
max = numbers[0];
|
|
|
|
max = numbers[0];
|
|
|
@ -19,6 +25,7 @@ void find_minmax(vector<double> numbers, double& min, double& max)
|
|
|
|
max = x;
|
|
|
|
max = x;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|