|
|
|
@ -7,22 +7,24 @@ struct Input {
|
|
|
|
|
size_t korz{};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Input input_data(istream& in) {
|
|
|
|
|
Input input_data(istream& in, bool prompt = false) {
|
|
|
|
|
Input lin;
|
|
|
|
|
size_t n, korz;
|
|
|
|
|
|
|
|
|
|
cerr << "Number of elements: ";
|
|
|
|
|
if(prompt)
|
|
|
|
|
cerr << "Number of elements: ";
|
|
|
|
|
in >> n;
|
|
|
|
|
lin.vec.resize(n);
|
|
|
|
|
for (size_t i = 0; i < n; i++)
|
|
|
|
|
in >> lin.vec[i];
|
|
|
|
|
cerr << "Enter bin count: ";
|
|
|
|
|
if(prompt)
|
|
|
|
|
cerr << "Enter bin count: ";
|
|
|
|
|
in >> lin.korz;
|
|
|
|
|
return lin;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
|
auto in = input_data(cin);
|
|
|
|
|
|
|
|
|
|
auto in = input_data(cin, true);
|
|
|
|
|
auto bins = make_histogram(in.korz, in.vec);
|
|
|
|
|
show_histogram_svg(bins);
|
|
|
|
|
}
|
|
|
|
|