From 0903f75d4078eedd7080c3cbdcf37c12005f3fe6 Mon Sep 17 00:00:00 2001 From: SavinSA Date: Mon, 22 Apr 2024 15:36:57 +0300 Subject: [PATCH] =?UTF-8?q?ind:=20=D0=BE=D1=82=D0=BA=D0=B0=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 7 +++---- svg.cpp | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/main.cpp b/main.cpp index cc64c2e..d6f810d 100644 --- a/main.cpp +++ b/main.cpp @@ -13,6 +13,8 @@ struct Input { Input input_data() { + int i; + string check(" "); size_t number_count; cerr << "Enter number count: "; cin >> number_count; @@ -29,10 +31,7 @@ input_data() { cerr << "Enter stroke colour without spaces or in code format:"; - cin >> in.stroke; - if (in.stroke.find(' ')) { - cerr << "bad input"; - } + cin >> in.stroke; return in; } diff --git a/svg.cpp b/svg.cpp index 83b98c0..cb758fd 100644 --- a/svg.cpp +++ b/svg.cpp @@ -54,7 +54,7 @@ show_histogram_svg(const vector& bins, string stroke) { const double bin_width = MAX_WIDTH * ((BLOCK_WIDTH * bin) / max_count); svg_text(TEXT_LEFT, top + TEXT_BASELINE, to_string(bin)); svg_rect(TEXT_WIDTH, top, bin_width, BIN_HEIGHT, stroke, "red"); - top += BIN_HEIGHT; + top += 2*BIN_HEIGHT; } svg_end(); }