From 0ab4123e0da5e17a0fa5066b7025db88855e4eb3 Mon Sep 17 00:00:00 2001 From: BykovDA Date: Mon, 19 May 2025 16:35:29 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=BF=D0=B0=D1=80=D0=B0=D0=BC=D0=B5=D1=82=D1=80=20pro?= =?UTF-8?q?mt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/main.cpp b/main.cpp index 5f45c7d..9f23bd4 100644 --- a/main.cpp +++ b/main.cpp @@ -9,22 +9,24 @@ struct Input { size_t bin_count{}; }; Input -input_data(istream& in) { +input_data(istream& in,bool promt = false) { size_t number_count; - cerr << "Number_count: "; + if (promt) + cerr << "Number_count: "; in >> number_count; Input im; im.numbers.resize(number_count); for (size_t i = 0; i < number_count; i++) { in >> im.numbers[i]; } - cerr << "Enter bin_count: "; + if (promt) + cerr << "Enter bin_count: "; in >> im.bin_count; return im; } int main() { - auto in = input_data(cin); + auto in = input_data(cin,true); auto bins = make_histogram(in.numbers, in.bin_count); show_histogram_svg(bins); return 0;