|
|
@ -14,11 +14,13 @@ struct Input
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
Input
|
|
|
|
Input
|
|
|
|
input_data(istream& in)
|
|
|
|
input_data(istream& in, bool prompt)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
size_t number_count;
|
|
|
|
size_t number_count;
|
|
|
|
|
|
|
|
if (prompt)
|
|
|
|
cerr<<"Enter number count: ";
|
|
|
|
cerr<<"Enter number count: ";
|
|
|
|
in >> number_count;
|
|
|
|
in >> number_count;
|
|
|
|
|
|
|
|
if (prompt)
|
|
|
|
cerr << "Enter numbers : " << endl;
|
|
|
|
cerr << "Enter numbers : " << endl;
|
|
|
|
|
|
|
|
|
|
|
|
Input ik;
|
|
|
|
Input ik;
|
|
|
@ -27,6 +29,7 @@ input_data(istream& in)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
cin >> ik.numbers[i];
|
|
|
|
cin >> ik.numbers[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (prompt)
|
|
|
|
cerr<< "Enter bin count: ";
|
|
|
|
cerr<< "Enter bin count: ";
|
|
|
|
cin >> ik.bin_count;
|
|
|
|
cin >> ik.bin_count;
|
|
|
|
return ik;
|
|
|
|
return ik;
|
|
|
@ -34,7 +37,7 @@ input_data(istream& in)
|
|
|
|
|
|
|
|
|
|
|
|
int main()
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
auto in = input_data(cin);
|
|
|
|
auto in = input_data(cin, true);
|
|
|
|
auto bins = make_histogram(in.numbers, in.bin_count);
|
|
|
|
auto bins = make_histogram(in.numbers, in.bin_count);
|
|
|
|
show_histogram_svg(bins);
|
|
|
|
show_histogram_svg(bins);
|
|
|
|
getch();
|
|
|
|
getch();
|
|
|
|