SavinSA 1 год назад
Родитель 0132140dad
Сommit 0903f75d40

@ -13,6 +13,8 @@ struct Input {
Input Input
input_data() { input_data() {
int i;
string check(" ");
size_t number_count; size_t number_count;
cerr << "Enter number count: "; cerr << "Enter number count: ";
cin >> number_count; cin >> number_count;
@ -29,10 +31,7 @@ input_data() {
cerr << "Enter stroke colour without spaces or in code format:"; cerr << "Enter stroke colour without spaces or in code format:";
cin >> in.stroke; cin >> in.stroke;
if (in.stroke.find(' ')) {
cerr << "bad input";
}
return in; return in;
} }

@ -54,7 +54,7 @@ show_histogram_svg(const vector<double>& bins, string stroke) {
const double bin_width = MAX_WIDTH * ((BLOCK_WIDTH * bin) / max_count); const double bin_width = MAX_WIDTH * ((BLOCK_WIDTH * bin) / max_count);
svg_text(TEXT_LEFT, top + TEXT_BASELINE, to_string(bin)); svg_text(TEXT_LEFT, top + TEXT_BASELINE, to_string(bin));
svg_rect(TEXT_WIDTH, top, bin_width, BIN_HEIGHT, stroke, "red"); svg_rect(TEXT_WIDTH, top, bin_width, BIN_HEIGHT, stroke, "red");
top += BIN_HEIGHT; top += 2*BIN_HEIGHT;
} }
svg_end(); svg_end();
} }

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