From 17c9ffecae8a7d0a052538b3330d0a188d6939d2 Mon Sep 17 00:00:00 2001 From: KirsanovES Date: Sun, 4 Jun 2023 20:47:16 +0300 Subject: [PATCH] =?UTF-8?q?test:=20=D1=83=D1=81=D0=BF=D0=B5=D1=88=D0=BD?= =?UTF-8?q?=D0=B0=D1=8F=20=D0=BA=D0=BE=D0=BC=D0=BF=D0=B8=D0=BB=D1=8F=D1=86?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=BF=D1=80=D0=BE=D0=B3=D1=80=D0=B0=D0=BC=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/main.cpp b/main.cpp index 04d2066..d7d1e31 100644 --- a/main.cpp +++ b/main.cpp @@ -3,6 +3,9 @@ #include "histogram.h" #include "text.h" #include"svg.h" +#include + + using namespace std; struct Input { @@ -11,25 +14,25 @@ struct Input { }; Input -input_data(istream& in){ - bool prompt = true; +input_data(istream& inx){ + bool prompt= true; size_t number_count; - if (prompt) cerr << "Input amount of numbers: " + if (prompt) cerr << "Input amount of numbers: "; cin >> number_count; Input in; - if (prompt) cerr << "Input some numbers: " in.numbers.resize(number_count); + if (prompt) cerr << "Input some numbers: "; for (size_t i = 0; i < number_count; i++) { - in >> in.numbers[i]; + inx >> in.numbers[i]; } - if (prompt) cerr << "Input number of buckets: " - in >> in.bin_count; + if (prompt) cerr << "Input amount of bockses: "; + inx >> in.bin_count; return in; } int main() -{ auto in = input_data(cin); +{ curl_global_init(CURL_GLOBAL_ALL); + auto in = input_data(cin); auto bins = make_histogram(in.numbers,in.bin_count); show_histogram_svg(bins); - }