From ff073e1bba20e38bcfa85b50d0edfa418a493a76 Mon Sep 17 00:00:00 2001 From: TarasovEE Date: Thu, 25 Sep 2025 22:11:00 +0300 Subject: [PATCH] =?UTF-8?q?source:=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B0=20find=5Fmax?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- histogram.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/histogram.cpp b/histogram.cpp index 2a34d2c..d33fcab 100644 --- a/histogram.cpp +++ b/histogram.cpp @@ -7,6 +7,13 @@ using namespace std; void find_minmax(const vector& numbers, double& min, double& max) { + if (numbers.empty()) + { + min = 0; + max = 0; + return; + } + min = numbers[0]; max = numbers[0];