From 85277aaf0cd9f506bec18fedaab9dc14ca5bc300 Mon Sep 17 00:00:00 2001 From: victoriaCS Date: Wed, 17 Sep 2025 22:22:49 +0300 Subject: [PATCH] =?UTF-8?q?code:=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20prompt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/main.cpp b/main.cpp index 5416286..cfc7c4f 100644 --- a/main.cpp +++ b/main.cpp @@ -10,9 +10,11 @@ struct Input { size_t bin_count{}; }; -Input input_data(istream& in) { +Input input_data(istream& in, bool prompt) { size_t number_count; - cerr << "Enter number count: "; + if (prompt){ + cerr << "Enter number count: " + } in >> number_count; Input in_data; @@ -22,14 +24,16 @@ Input input_data(istream& in) { in >> in_data.numbers[i]; } - cerr << "Enter bin count: "; + if (prompt){ + cer << "Enter bin count: " + } in >> in_data.bin_count; return in_data; } 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); }