From ac681b72f18635c50d5dafdab65f5aa6e486fdda Mon Sep 17 00:00:00 2001 From: "lab34 (BiriukovaAlS)" Date: Mon, 24 Apr 2023 02:13:51 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=B4=D0=BE=20=D0=BF=D1=83=D0=BD=D0=BA=D1=82?= =?UTF-8?q?=D0=B0=205?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 90 +++++--------------------------------------------------- 1 file changed, 7 insertions(+), 83 deletions(-) diff --git a/main.cpp b/main.cpp index 1ee4b41..b217cf0 100644 --- a/main.cpp +++ b/main.cpp @@ -1,14 +1,17 @@ #include #include #include +#include "histogram.h" +#include "text.h" using namespace std; - struct Input { +struct Input +{ vectornumbers; size_t kol_kor{}; - }; +}; Input input_data() @@ -19,7 +22,7 @@ input_data() Input in; in.numbers.resize(number_count); - for (size_t i=0; i MAX_ASTERISK) - { - count = B[i]; - height = MAX_ASTERISK * (static_cast(count) / max_count); - } - - else - { - height = B[i]; - } - - for (j = 0; j < height; j++) - { - cout << "*"; - } - cout << endl; - } - } -} int main() { Input in = input_data(); auto B = make_histogram(in.numbers, in.kol_kor); - show_histogram (B, in.kol_kor); + show_histogram_text(B, in.kol_kor); return 0; }