From 7470cdab43225c161da19a3565414143d6a877ba Mon Sep 17 00:00:00 2001 From: LedovskojMM Date: Sun, 23 Apr 2023 21:13:40 +0300 Subject: [PATCH] =?UTF-8?q?=D1=81=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20text?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lab1.depend | 15 +++++++++++++++ main.cpp | 21 +-------------------- text.cpp | 21 +++++++++++++++++++++ text.h | 8 ++++++++ 4 files changed, 45 insertions(+), 20 deletions(-) create mode 100644 text.cpp create mode 100644 text.h diff --git a/lab1.depend b/lab1.depend index ab181f3..fdaeffe 100644 --- a/lab1.depend +++ b/lab1.depend @@ -12,3 +12,18 @@ 1682271932 c:\users\admin\onedrive\Рабочий стол\lab1\histogam.h +1682272812 source:c:\users\admin\onedrive\Рабочий стол\lab1\histogam.cpp + + + + "histogam.h" + +1682273357 source:c:\users\admin\onedrive\Рабочий стол\lab1\text.cpp + + + + "text.h" + +1682273447 c:\users\admin\onedrive\Рабочий стол\lab1\text.h + + diff --git a/main.cpp b/main.cpp index 7d61636..49fb625 100644 --- a/main.cpp +++ b/main.cpp @@ -2,6 +2,7 @@ #include #include #include "histogam.h" +#include "text.h" using namespace std; @@ -27,26 +28,6 @@ input_data() { return in; } - -void show_histogram_text(vector bins, size_t bin_count ) { - - for (size_t i = 0; i < bin_count; i++) { - if (bins[i] < 100) { - cout << " "; - } - if (bins[i] < 10) { - cout << " "; - } - cout << bins[i] << "|"; - for (size_t j = 0; j < bins[i]; j++) { - cout << "*"; - } - cout << "\n"; - } -} - - - int main() { Input in = input_data(); diff --git a/text.cpp b/text.cpp new file mode 100644 index 0000000..d44d87e --- /dev/null +++ b/text.cpp @@ -0,0 +1,21 @@ +#include +#include +#include +#include "text.h" +using namespace std; +void show_histogram_text(vector bins, size_t bin_count ) { + + for (size_t i = 0; i < bin_count; i++) { + if (bins[i] < 100) { + cout << " "; + } + if (bins[i] < 10) { + cout << " "; + } + cout << bins[i] << "|"; + for (size_t j = 0; j < bins[i]; j++) { + cout << "*"; + } + cout << "\n"; + } +} diff --git a/text.h b/text.h new file mode 100644 index 0000000..6779782 --- /dev/null +++ b/text.h @@ -0,0 +1,8 @@ +#ifndef TEXT_H_INCLUDED +#define TEXT_H_INCLUDED +#include + +void show_histogram_text(std::vector bins, size_t bin_count ); + + +#endif // TEXT_H_INCLUDED