From f04f03e39d63dd3a46a7f6591db6d98497268905 Mon Sep 17 00:00:00 2001 From: artemzelenov Date: Mon, 22 May 2023 14:21:31 +0300 Subject: [PATCH] =?UTF-8?q?code:=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20bool=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=BD=D1=83=D1=8E=20prompt=20=D0=B4=D0=BB=D1=8F=20=D0=B2=D1=8B?= =?UTF-8?q?=D0=B2=D0=BE=D0=B4=D0=B0=20=D0=BF=D0=BE=D0=B4=D1=81=D0=BA=D0=B0?= =?UTF-8?q?=D0=B7=D0=BE=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/main.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/project/main.cpp b/project/main.cpp index 717dfb8..efafb70 100644 --- a/project/main.cpp +++ b/project/main.cpp @@ -12,9 +12,10 @@ struct Input }; Input -input_data(istream& tin) +input_data(istream& tin, bool prompt) { size_t number_count; + if (prompt) cerr << "Enter number count: "; tin >> number_count; Input in; @@ -23,13 +24,16 @@ input_data(istream& tin) { tin >> in.numbers[i]; } + if (prompt) + { cerr << "Enter bin count: "; + } tin >> in.bin_count; return in; } int main() { - Input in = input_data(cin); + Input in = input_data(cin,true); auto bins = make_histogram(in.numbers, in.bin_count); show_histogram_svg(bins); return 0;