From 09b33411b624646ae1bb5a0973d2ce07aa6fe2da Mon Sep 17 00:00:00 2001 From: KhodiukMR Date: Mon, 13 May 2024 14:39:03 +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=B0=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=BD=D0=B0=20=D0=B2=D1=8B=D0=B2=D0=BE=D0=B4=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=B4=D1=81=D0=BA=D0=B0=D0=B7=D0=BE=D0=BA=20cerr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CommonVar.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/CommonVar.cpp b/CommonVar.cpp index d35316b..7510dc6 100644 --- a/CommonVar.cpp +++ b/CommonVar.cpp @@ -13,12 +13,16 @@ struct Input { }; Input -InputData(istream& in) { +InputData(istream& in, bool prompt) { Input inp; size_t NumberCount; - cerr << "Enter number count: "; + if (prompt) { + cerr << "Enter number count: "; + } in >> NumberCount; - cerr << "Enter bin count: "; + if (prompt) { + cerr << "Enter bin count: "; + } in >> inp.BinCount; inp.Numbers.resize(NumberCount); for (int i = 0; i < NumberCount; i++) { @@ -35,7 +39,7 @@ void ShowHistogrammText(vector Bins); int main() { double MaxCount = 0; - Input in = InputData(cin); + Input in = InputData(cin, true); vector Bins(in.BinCount); Bins = MakeHistogram(in.Numbers, in.BinCount, MaxCount); ShowHistogramSvg(Bins);