|
|
|
@ -12,11 +12,13 @@ struct Input
|
|
|
|
|
size_t bin_count{};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Input input_data(istream& stream)
|
|
|
|
|
Input input_data(istream& stream, bool prompt)
|
|
|
|
|
{
|
|
|
|
|
Input in;
|
|
|
|
|
size_t number_count;
|
|
|
|
|
cerr << "Enter num count >>";
|
|
|
|
|
if (prompt){
|
|
|
|
|
cerr << "Enter num count >>";
|
|
|
|
|
}
|
|
|
|
|
stream >> number_count;
|
|
|
|
|
|
|
|
|
|
in.numbers.resize(number_count);
|
|
|
|
@ -25,7 +27,9 @@ Input input_data(istream& stream)
|
|
|
|
|
{
|
|
|
|
|
stream >> in.numbers[i];
|
|
|
|
|
}
|
|
|
|
|
cerr << "Enter bin count >>";
|
|
|
|
|
if (prompt){
|
|
|
|
|
cerr << "Enter bin count >>";
|
|
|
|
|
}
|
|
|
|
|
stream >> in.bin_count;
|
|
|
|
|
return in;
|
|
|
|
|
}
|
|
|
|
@ -33,7 +37,7 @@ Input input_data(istream& stream)
|
|
|
|
|
int main()
|
|
|
|
|
{
|
|
|
|
|
bool prompt = true;
|
|
|
|
|
auto in = input_data(cin);
|
|
|
|
|
auto in = input_data(cin, prompt);
|
|
|
|
|
auto bins = make_histogram(in.numbers, in.bin_count);
|
|
|
|
|
show_histogram_svg(bins);
|
|
|
|
|
}
|
|
|
|
|