code: вывод гистограммы

master
EfimovaLA 12 месяцев назад
Родитель 1a8a322528
Сommit cf21c702a9

@ -69,11 +69,19 @@ vector<size_t> make_histogram(vector<double> &numbers, size_t bin_count) {
} }
return bins; return bins;
} }
void show_histogram_text(vector<size_t> &bins){
size_t maxbin = bins[0];
for (size_t i=1; i < bins.size(); i++){
if (maxbin < bins[i]){
maxbin = bins[i];
}
}
}
int main() int main()
{ {
Input in = input_data(); Input in = input_data();
auto bins = make_histogram(in.numbers, in.bin_count); auto bins = make_histogram(in.numbers, in.bin_count);
show_histogram_text(bins);
size_t maxbin = bins[0]; size_t maxbin = bins[0];
for (size_t i=1; i < in.bin_count; i++){ for (size_t i=1; i < in.bin_count; i++){

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