code: исправление ошибок

master
u115-03 7 месяцев назад
Родитель 91b6bea919
Сommit 59b6fa5051

@ -5,14 +5,19 @@
using namespace std; using namespace std;
void find_minmax(const vector<double> &numbers, double &min, double &max){ void find_minmax(const vector<double> &numbers, double &min, double &max){
min = numbers[0]; if (numbers.size() == 0){
max = numbers[0]; min = 0;
for (double x : numbers) { max = 0;
if (x < min) { } else {
min = x; min = numbers[0];
} max = numbers[0];
else if (x > max) { for (double x : numbers) {
max = x; if (x < min) {
min = x;
}
else if (x > max) {
max = x;
}
} }
} }
} }

@ -3,6 +3,6 @@
#include <vector> #include <vector>
void find_minmax(const std::vector<double> &numbers, double &min, double &max) void find_minmax(const std::vector<double> &numbers, double &min, double &max);
#endif // HISTOGRAM_INTERNAL_H_INCLUDED #endif // HISTOGRAM_INTERNAL_H_INCLUDED

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