From ee56f1cb65261a61f88e80de20bbe74051e1c6a6 Mon Sep 17 00:00:00 2001 From: IvanonVG Date: Sat, 24 May 2025 23:59:12 +0300 Subject: [PATCH] =?UTF-8?q?code:=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA?= =?UTF-8?q?=D0=B8=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=8B=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 9427aac..60e4f9a 100644 --- a/main.cpp +++ b/main.cpp @@ -20,19 +20,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; } @@ -74,8 +74,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; }