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; }