From 9ca4920874d4720071f9e87e502f0ae1fa2e1a4c Mon Sep 17 00:00:00 2001 From: IshutinaYI Date: Sun, 4 Jun 2023 13:17:44 +0300 Subject: [PATCH] =?UTF-8?q?(new)=20code:=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=20=D1=83=D0=BD=D0=B8=D0=B2=D0=B5=D1=80=D1=81?= =?UTF-8?q?=D0=B0=D0=BB=D1=8C=D0=BD=D1=8B=D0=B9=20=D0=BF=D0=BE=D1=82=D0=BE?= =?UTF-8?q?=D0=BA=20=D0=B4=D0=BB=D1=8F=20=D1=87=D1=82=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fin_lab34.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fin_lab34.cpp b/fin_lab34.cpp index b124c60..75f0990 100644 --- a/fin_lab34.cpp +++ b/fin_lab34.cpp @@ -16,7 +16,7 @@ struct Input{ }; Input -input_data(){ +input_data(istream &thread){ size_t number_count; cin >> number_count; Input in; @@ -32,11 +32,13 @@ int main(){ double min = 0, max = 0; size_t font = 0; - Input in = input_data(); + auto in = input_data(cin); auto bins = make_histogram(in.numbers, in.bin_count); //for (auto now: bins) {cout << now << endl;} cin >> font; - show_histogram_svg(bins, font); + if (font < 8) {cerr << "Font value is too small. Please, edit the input file.";} + else if (font > 32) {cerr << "Font value is too large. Please, edit the input file.";} + else {show_histogram_svg(bins, font);} return 0; }