From 9f95f41fd9dfb407800d87212334cec6387c148d Mon Sep 17 00:00:00 2001 From: GordiyevskikDA Date: Sun, 14 Apr 2024 06:18:18 +0300 Subject: [PATCH] =?UTF-8?q?code:=20=D0=B8=D0=B7=D0=BD=D0=B0=D1=87=D0=B0?= =?UTF-8?q?=D0=BB=D1=8C=D0=BD=D1=8B=D0=B9=20=D0=B4=D0=BB=D1=8F=20Lab4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LABA1.cpp | 1 - histogram.cpp | 6 +++--- unittest.vcxproj.user | 4 ++++ 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 unittest.vcxproj.user diff --git a/LABA1.cpp b/LABA1.cpp index 06dc84c..36c7c63 100644 --- a/LABA1.cpp +++ b/LABA1.cpp @@ -68,7 +68,6 @@ struct Input { Input input_data() { Input in; - Input in2; int VecSize = 0; cin >> VecSize; in.marks.resize(VecSize); diff --git a/histogram.cpp b/histogram.cpp index a4c686b..5f13b9d 100644 --- a/histogram.cpp +++ b/histogram.cpp @@ -3,8 +3,7 @@ using namespace std; void FindMinMax(const vector& marks, double& min, double& max) { max = 0; - min = 0; - if (marks.size() = 0) { + if (marks.size() != 0) { min = marks[0]; for (double x : marks) { if (x > max) { @@ -14,9 +13,10 @@ void FindMinMax(const vector& marks, double& min, double& max) { min = x; } } - } + }else{ min = 0; } } + vector MakeHistogram(const vector& marks, int NCharts) { double interval = 0, i = 0, min = 0, max = 0; vector chart(NCharts); diff --git a/unittest.vcxproj.user b/unittest.vcxproj.user new file mode 100644 index 0000000..88a5509 --- /dev/null +++ b/unittest.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file