From 37e16c31d310ddf663e7c52ec0c5d389e209b82c Mon Sep 17 00:00:00 2001 From: ShchegolikhYR Date: Fri, 30 May 2025 13:59:00 +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=20=D0=BF=D0=B0=D1=80=D0=B0=D0=BC=D0=B5=D1=82=D1=80?= =?UTF-8?q?=20bool=5Fprompt=20=D0=B2=20=D1=84=D1=83=D0=BD=D0=BA=D1=86?= =?UTF-8?q?=D0=B8=D1=8E=20input=5Fdata()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.cpp b/main.cpp index 846440e..9cacb3f 100644 --- a/main.cpp +++ b/main.cpp @@ -11,20 +11,20 @@ struct Input { size_t bin_count{}; }; -Input input_data(istream& in) { +Input input_data(istream& in, bool prompt = 0) { size_t number_count; - cerr << "Введите кол-во чисел в строке: "; + if (prompt) cerr << "Введите кол-во чисел в строке: "; in >> number_count; Input input; input.numbers.resize(number_count); - cerr << "Введите строку чисел: "; + if (prompt) cerr << "Введите строку чисел: "; for (int i = 0; i < number_count; i++) { in >> input.numbers[i]; } - cerr << "Введите кол-во корзин: "; + if (prompt) cerr << "Введите кол-во корзин: "; in >> input.bin_count; return input; }