|
|
@ -2,14 +2,20 @@
|
|
|
|
#include <conio.h>
|
|
|
|
#include <conio.h>
|
|
|
|
#include <vector>
|
|
|
|
#include <vector>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
#include "histogram.h"
|
|
|
|
#include "histogram.h"
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
find_minmax(const vector<double>& numbers, double& min, double& max){
|
|
|
|
find_minmax(const vector<double>& numbers, double& min, double& max){
|
|
|
|
|
|
|
|
if (numbers.empty()){
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
min = numbers[0];
|
|
|
|
min = numbers[0];
|
|
|
|
min = numbers[0];
|
|
|
|
max = numbers[0];
|
|
|
|
for(size_t i=0; i < numbers.size(); i++){
|
|
|
|
for(size_t i=0; i < numbers.size(); i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
if (numbers[i] < min)
|
|
|
|
if (numbers[i] < min)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
min = numbers[i];
|
|
|
|
min = numbers[i];
|
|
|
@ -19,6 +25,8 @@ find_minmax(const vector<double>& numbers, double& min, double& max){
|
|
|
|
max = numbers[i];
|
|
|
|
max = numbers[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|