|
|
|
@ -5,21 +5,23 @@ struct Input {
|
|
|
|
|
vector<double> vec;
|
|
|
|
|
size_t korz{};
|
|
|
|
|
};
|
|
|
|
|
Input input_data(istream& in) {
|
|
|
|
|
Input input_data(istream& in, bool promt = false) {
|
|
|
|
|
Input lin;
|
|
|
|
|
size_t n, korz;
|
|
|
|
|
|
|
|
|
|
cerr << "Number of elem ";
|
|
|
|
|
if(promt)
|
|
|
|
|
cerr << "Number of elem ";
|
|
|
|
|
in >> n;
|
|
|
|
|
lin.vec.resize(n);
|
|
|
|
|
for (size_t i = 0; i < n; i++)
|
|
|
|
|
in >> lin.vec[i];
|
|
|
|
|
cerr << "Enter bin count: ";
|
|
|
|
|
if(promt)
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|