Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

41 строка
717 B
C++

#include <iostream>
#include "histogram.h"
#include "text.h"
using namespace std;
struct Input {
vector<double> numbers;
size_t bin_count{};
};
Input input_data() {
Input in;
int number_count;
do {
cout << "Enter number count: ";
cin >> number_count;
} while (number_count < 1);
do {
cout << "Enter bucket: ";
cin >> in.bin_count;
} while (in.bin_count < 1);
cout << "\n";
in.numbers.resize(number_count);
for (int i = 0; i < number_count; i++) {
cin >> in.numbers[i];
}
return in;
}
int main() {
auto in = input_data();
auto bins = make_histogram(in.numbers, in.bin_count);
show_histogram_text(bins);
}