From 5057f8497542c66f4c8bf39f7025b67dd10fdb01 Mon Sep 17 00:00:00 2001 From: "Igor (ZharkovIG)" Date: Sun, 20 Oct 2024 15:14:33 +0300 Subject: [PATCH] =?UTF-8?q?code:=20=D0=94=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?=20primpt=20=D0=B2=20input=5Fdata()?= 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 c72f2cf..9a7a0bf 100644 --- a/main.cpp +++ b/main.cpp @@ -10,20 +10,19 @@ struct Input { }; Input -input_data(istream& in){ - +input_data(istream& in, bool prompt){ size_t number_count; - cerr << "Enter number_count: "; + if (prompt == true) cerr << "Enter number_count: "; cin >> number_count; Input in; in.numbers.resize(number_count); - cerr << "Enter numbers: "; + if (prompt == true) cerr << "Enter numbers: "; for (size_t i = 0; i < number_count; i++){ cin >> in.numbers[i]; } - cerr << "Enter bin count: "; + if (prompt == true) cerr << "Enter bin count: "; cin >> in.bin_count; return in;