From 5fe3586d4d1d9d16f828f8ac94c30504b89e32fd Mon Sep 17 00:00:00 2001 From: GordiyevskikDA Date: Tue, 5 Mar 2024 20:06:17 +0300 Subject: [PATCH] =?UTF-8?q?code:=20=D0=92=D1=8B=D0=BD=D0=BE=D1=81=20=D1=80?= =?UTF-8?q?=D0=B0=D1=81=D1=87=D1=91=D1=82=D0=B0=20=D0=B4=D0=B8=D0=B0=D0=B3?= =?UTF-8?q?=D1=80=D0=B0=D0=BC=D0=BC=D1=8B=20=D0=B2=20=D0=BE=D1=82=D0=B4?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C=D0=BD=D1=8B=D0=B9=20=D1=84=D0=B0=D0=B9=D0=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LABA1.cpp | 10 +--------- histogram.cpp | 3 +-- histogram.h | 1 + 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/LABA1.cpp b/LABA1.cpp index b8f0b2e..d11a2ef 100644 --- a/LABA1.cpp +++ b/LABA1.cpp @@ -1,14 +1,6 @@ #include #include -#include "histogram.cpp" -/* -Костыль!!!!! -#include "histogram.h" не работает, тем не менее, всё по методичке -работает только с #include "histogram.cpp" -разобраться!!!!!!!! - -Вынести печать в show_histogram_text(), а его в отдельный cpp и h -*/ +#include "histogram.h" using namespace std; struct Input { diff --git a/histogram.cpp b/histogram.cpp index 4653a64..38ded28 100644 --- a/histogram.cpp +++ b/histogram.cpp @@ -1,5 +1,4 @@ #include "histogram.h" - using namespace std; void FindMinMax(const vector& marks, double& min, double& max) { @@ -15,7 +14,7 @@ void FindMinMax(const vector& marks, double& min, double& max) { } }; -vector MakeHistogram(const vector& marks, int NCharts) { +static vector MakeHistogram(const vector& marks, int NCharts) { double interval = 0, i = 0, min = 0, max = 0; vector chart(NCharts); FindMinMax(marks, min, max); diff --git a/histogram.h b/histogram.h index 762c793..1199262 100644 --- a/histogram.h +++ b/histogram.h @@ -1,5 +1,6 @@ #ifndef HISTOGRAM_H_INCLUDED #define HISTOGRAM_H_INCLUDED +#include "histogram.cpp" //, . ! #include std::vector MakeHistogram(const std::vector& marks, int NCharts);