From cbcdcf8f254474e1b1f0772c1d00c620e4742766 Mon Sep 17 00:00:00 2001 From: DmitriyevDM Date: Sun, 18 May 2025 23:36:31 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B8?= =?UTF-8?q?=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=8B=20=D1=81=20=D1=81=D1=81?= =?UTF-8?q?=D1=8B=D0=BB=D0=BA=D0=B0=D0=BC=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/main.cpp b/main.cpp index 0d88070..39229ea 100644 --- a/main.cpp +++ b/main.cpp @@ -19,19 +19,19 @@ Input input_data(istream& in, bool prompt) { if (prompt){ cerr << "Enter number count: "; } - cin >> number_count; + in >> number_count; inp.numbers.resize(number_count); if (prompt){ cerr << "Enter numbers: "; } for (size_t i = 0; i < number_count; i++) { - cin >> inp.numbers[i]; + in >> inp.numbers[i]; } if (prompt) { cerr << "Enter bin count: "; } - cin >> inp.bin_count; + in >> inp.bin_count; return inp; } @@ -71,8 +71,7 @@ int main(int argc, char* argv[]) { input = input_data(cin, true); } - auto in = input_data(cin, true); - auto bins = make_histogram(in.numbers, in.bin_count); + auto bins = make_histogram(input.numbers, input.bin_count); show_histogram_svg(bins); return 0; }