code: code for var 1
Этот коммит содержится в:
23
main.cpp
23
main.cpp
@@ -3,7 +3,7 @@
|
|||||||
#include "histogram.h"
|
#include "histogram.h"
|
||||||
#include "svg.h"
|
#include "svg.h"
|
||||||
#include "text.h"
|
#include "text.h"
|
||||||
|
//#include "mycheck.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@@ -14,21 +14,28 @@ struct Input
|
|||||||
{
|
{
|
||||||
vector<double> numbers;
|
vector<double> numbers;
|
||||||
size_t bin_count{};
|
size_t bin_count{};
|
||||||
|
size_t IMAGE_WIDTH{};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Input input_data()
|
Input input_data()
|
||||||
{
|
{
|
||||||
|
|
||||||
size_t number_count, bin_count;
|
size_t number_count, bin_count, IMAGE_WIDTH;
|
||||||
|
|
||||||
cerr << "Enter number count: ";
|
cerr << "Enter number count: ";
|
||||||
cin >> number_count;
|
cin >> number_count;
|
||||||
|
|
||||||
Input in;
|
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);
|
in.numbers.resize(number_count);
|
||||||
|
|
||||||
cerr << "Enter numbers: ";
|
cerr << "Enter numbers: ";
|
||||||
|
|
||||||
// vector<double> numbers(number_count);
|
// vector<double> numbers(number_count);
|
||||||
|
|
||||||
for (size_t i = 0; i < number_count; i++)
|
for (size_t i = 0; i < number_count; i++)
|
||||||
@@ -44,8 +51,14 @@ Input input_data()
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
|
||||||
auto in = input_data();
|
auto in = input_data();
|
||||||
auto bins = make_histogram(in.numbers, in.bin_count);
|
auto bins = make_histogram(in.numbers, in.bin_count);
|
||||||
show_histogram_svg(bins);
|
//int chek_block_width(in.IMAGE_WIDTH);
|
||||||
return 0;
|
//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);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user