|
|
|
@ -1,5 +1,7 @@
|
|
|
|
|
#include <iostream>
|
|
|
|
|
#include <vector>
|
|
|
|
|
#include "histogram.h"
|
|
|
|
|
#include "text.h"
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
|
// Ñòðóêòóðà
|
|
|
|
@ -16,7 +18,7 @@ Input
|
|
|
|
|
input_data()
|
|
|
|
|
{
|
|
|
|
|
Input in;
|
|
|
|
|
size_t number_count, bin_count;
|
|
|
|
|
size_t number_count;
|
|
|
|
|
|
|
|
|
|
cerr << "Enter number count: ";
|
|
|
|
|
cin >> number_count;
|
|
|
|
@ -28,25 +30,10 @@ input_data()
|
|
|
|
|
return in;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Ïîèñê ìàêñèìóìà è ìèíèìóìà ñðåäè îöåíîê.
|
|
|
|
|
|
|
|
|
|
void find_minmax(const vector<double>& numbers, double& min, double& max)
|
|
|
|
|
{
|
|
|
|
|
min = numbers[0];
|
|
|
|
|
max = numbers[0];
|
|
|
|
|
|
|
|
|
|
for (double x : numbers)
|
|
|
|
|
{
|
|
|
|
|
if (x < min)
|
|
|
|
|
min = x;
|
|
|
|
|
else if (x > max)
|
|
|
|
|
max = x;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int main()
|
|
|
|
|
{
|
|
|
|
|
auto in = input_data();
|
|
|
|
|
auto bins = make_histogram(in.numbers, in.bin_count);
|
|
|
|
|
show_histogram_text(bins, ...);
|
|
|
|
|
show_histogram_text(bins, in.bin_count);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|