From 0074569925e9703b934f8b0b0c10afb548698377 Mon Sep 17 00:00:00 2001 From: "Daniil (FilippovDY)" Date: Sun, 5 May 2024 22:51:02 +0300 Subject: [PATCH] =?UTF-8?q?build:=20=D1=81=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20histogram=5Finternal.h?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lab01.cbp | 1 + histogram.cpp | 2 +- histogram_internal.h | 8 ++++++++ text.cpp | 4 ++-- 4 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 histogram_internal.h diff --git a/Lab01.cbp b/Lab01.cbp index aa7d216..d645cb5 100644 --- a/Lab01.cbp +++ b/Lab01.cbp @@ -33,6 +33,7 @@ + diff --git a/histogram.cpp b/histogram.cpp index ebae521..6477f85 100644 --- a/histogram.cpp +++ b/histogram.cpp @@ -1,6 +1,6 @@ #include "histogram.h" #include -static void find_minmax(const std::vector &numbers, double &min, double &max) +void find_minmax(const std::vector &numbers, double &min, double &max) { min = numbers[0]; max = numbers[0]; diff --git a/histogram_internal.h b/histogram_internal.h new file mode 100644 index 0000000..44594cb --- /dev/null +++ b/histogram_internal.h @@ -0,0 +1,8 @@ +#ifndef HISTOGRAM_INTERNAL_H_INCLUDED +#define HISTOGRAM_INTERNAL_H_INCLUDED + +#include + +void find_minmax(const std::vector &numbers, double &min, double &max, bool &res); + +#endif // HISTOGRAM_INTERNAL_H_INCLUDED diff --git a/text.cpp b/text.cpp index f272c99..34c7d59 100644 --- a/text.cpp +++ b/text.cpp @@ -40,7 +40,7 @@ show_histogram_text(const std::vector &bins) else { - for (int i = 0; i < bins.size(); i++) + for (std::size_t i = 0; i < bins.size(); i++) { if (bins[i] < 100) { @@ -51,7 +51,7 @@ show_histogram_text(const std::vector &bins) } } std::cout << bins[i] << "|"; - for (int j = 0; j < bins[i]; j++) + for (std::size_t j = 0; j < bins[i]; j++) { std::cout << "*"; }