build: создание histogram_internal.h

main
Daniil (FilippovDY) 12 месяцев назад
Родитель 8847086e08
Сommit 0074569925

@ -33,6 +33,7 @@
<Add option="-fexceptions" /> <Add option="-fexceptions" />
</Compiler> </Compiler>
<Unit filename="histogram.cpp" /> <Unit filename="histogram.cpp" />
<Unit filename="histogram_internal.h" />
<Unit filename="main.cpp" /> <Unit filename="main.cpp" />
<Unit filename="text.cpp" /> <Unit filename="text.cpp" />
<Unit filename="text.h" /> <Unit filename="text.h" />

@ -1,6 +1,6 @@
#include "histogram.h" #include "histogram.h"
#include <vector> #include <vector>
static void find_minmax(const std::vector <double> &numbers, double &min, double &max) void find_minmax(const std::vector <double> &numbers, double &min, double &max)
{ {
min = numbers[0]; min = numbers[0];
max = numbers[0]; max = numbers[0];

@ -0,0 +1,8 @@
#ifndef HISTOGRAM_INTERNAL_H_INCLUDED
#define HISTOGRAM_INTERNAL_H_INCLUDED
#include <vector>
void find_minmax(const std::vector <double> &numbers, double &min, double &max, bool &res);
#endif // HISTOGRAM_INTERNAL_H_INCLUDED

@ -40,7 +40,7 @@ show_histogram_text(const std::vector <std::size_t> &bins)
else else
{ {
for (int i = 0; i < bins.size(); i++) for (std::size_t i = 0; i < bins.size(); i++)
{ {
if (bins[i] < 100) if (bins[i] < 100)
{ {
@ -51,7 +51,7 @@ show_histogram_text(const std::vector <std::size_t> &bins)
} }
} }
std::cout << bins[i] << "|"; std::cout << bins[i] << "|";
for (int j = 0; j < bins[i]; j++) for (std::size_t j = 0; j < bins[i]; j++)
{ {
std::cout << "*"; std::cout << "*";
} }

Загрузка…
Отмена
Сохранить