Родитель
6bdb705ac8
Сommit
d9022af3f9
@ -1,4 +1,5 @@
|
||||
#pragma once
|
||||
#include <vector>
|
||||
|
||||
bool find_minmax(const std::vector<double>& numbers, double& min, double& max);
|
||||
bool find_minmax(const std::vector<double>& numbers, double& min, double& max);
|
||||
int color(int bin, int max_count);
|
@ -0,0 +1,15 @@
|
||||
#include "histogram_internal.h"
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
int color(int bin, int max_count) {
|
||||
if (max_count == 0) {
|
||||
return 0;
|
||||
}
|
||||
int color;
|
||||
return color = round((10 - (bin * 9) / max_count));
|
||||
}
|
Загрузка…
Ссылка в новой задаче