Dima (AntonovDA) 1 год назад
Родитель 138de1fe70
Сommit 46e21dec49

@ -7,14 +7,15 @@
using namespace std; using namespace std;
const size_t SCREEN_WIDTH = 80; //const size_t SCREEN_WIDTH = 80;
const size_t MAX_ASTERISK = SCREEN_WIDTH - 3 - 1; //const size_t MAX_ASTERISK = SCREEN_WIDTH - 3 - 1;
struct Input struct Input
{ {
vector<double> numbers; vector<double> numbers;
size_t bin_count{}; size_t bin_count{};
size_t IMAGE_WIDTH{}; size_t IMAGE_WIDTH{};
bool valid;
}; };
@ -28,13 +29,19 @@ Input input_data()
Input in; Input in;
cerr << " Input width of image, >70 but not >800 : ";
cerr << " Input width of image, > 70 but not >800 : ";
cin >> in.IMAGE_WIDTH; cin >> in.IMAGE_WIDTH;
if(in.IMAGE_WIDTH < 70 || in.IMAGE_WIDTH > 800 ) {
while(in.IMAGE_WIDTH < 70 || in.IMAGE_WIDTH > 800) {
cerr << " Input width of image, >70 but not >800 : ";
cin >> in.IMAGE_WIDTH;
}
}
//size_t number_count = in.number_counts; //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);
@ -53,11 +60,11 @@ 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 );
//int chek_block_width(in.IMAGE_WIDTH); //int chek_block_width(in.IMAGE_WIDTH);
//chek_block_width(in.IMAGE_WIDTH, in.number_count); //chek_block_width(in.IMAGE_WIDTH, in.number_count);
//if (chek_block_width==1) //if (chek_block_width==1)
show_histogram_svg(bins,in.IMAGE_WIDTH); show_histogram_svg( bins,in.IMAGE_WIDTH );
//if(chek_block_width==0) return 0; //if(chek_block_width==0) return 0;
//show_histogram_svg(bins); //show_histogram_svg(bins);

Загрузка…
Отмена
Сохранить