|
|
|
@ -3,7 +3,7 @@
|
|
|
|
|
#include "histogram.h"
|
|
|
|
|
#include "svg.h"
|
|
|
|
|
#include "text.h"
|
|
|
|
|
|
|
|
|
|
//#include "mycheck.h"
|
|
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
@ -14,21 +14,28 @@ struct Input
|
|
|
|
|
{
|
|
|
|
|
vector<double> numbers;
|
|
|
|
|
size_t bin_count{};
|
|
|
|
|
size_t IMAGE_WIDTH{};
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Input input_data()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
size_t number_count, bin_count;
|
|
|
|
|
size_t number_count, bin_count, IMAGE_WIDTH;
|
|
|
|
|
|
|
|
|
|
cerr << "Enter number count: ";
|
|
|
|
|
cin >> number_count;
|
|
|
|
|
|
|
|
|
|
Input in;
|
|
|
|
|
|
|
|
|
|
cerr << " Input width of image, >70 but not >800 : ";
|
|
|
|
|
cin >> in.IMAGE_WIDTH;
|
|
|
|
|
|
|
|
|
|
//size_t number_count = in.number_counts;
|
|
|
|
|
|
|
|
|
|
in.numbers.resize(number_count);
|
|
|
|
|
|
|
|
|
|
cerr << "Enter numbers: ";
|
|
|
|
|
|
|
|
|
|
// vector<double> numbers(number_count);
|
|
|
|
|
|
|
|
|
|
for (size_t i = 0; i < number_count; i++)
|
|
|
|
@ -43,9 +50,15 @@ Input input_data()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int main()
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
auto in = input_data();
|
|
|
|
|
auto bins = make_histogram(in.numbers, in.bin_count);
|
|
|
|
|
show_histogram_svg(bins);
|
|
|
|
|
return 0;
|
|
|
|
|
//int chek_block_width(in.IMAGE_WIDTH);
|
|
|
|
|
//chek_block_width(in.IMAGE_WIDTH, in.number_count);
|
|
|
|
|
//if (chek_block_width==1)
|
|
|
|
|
show_histogram_svg(bins,in.IMAGE_WIDTH);
|
|
|
|
|
//if(chek_block_width==0) return 0;
|
|
|
|
|
//show_histogram_svg(bins);
|
|
|
|
|
|
|
|
|
|
}
|