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];