|
|
|
@ -20,19 +20,19 @@ Input input_data(istream& in, bool prompt) {
|
|
|
|
|
if (prompt){
|
|
|
|
|
cerr << "Enter number count: ";
|
|
|
|
|
}
|
|
|
|
|
cin >> number_count;
|
|
|
|
|
in >> number_count;
|
|
|
|
|
inp.numbers.resize(number_count);
|
|
|
|
|
if (prompt){
|
|
|
|
|
cerr << "Enter numbers: ";
|
|
|
|
|
}
|
|
|
|
|
for (size_t i = 0; i < number_count; i++) {
|
|
|
|
|
cin >> inp.numbers[i];
|
|
|
|
|
in >> inp.numbers[i];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (prompt) {
|
|
|
|
|
cerr << "Enter bin count: ";
|
|
|
|
|
}
|
|
|
|
|
cin >> inp.bin_count;
|
|
|
|
|
in >> inp.bin_count;
|
|
|
|
|
return inp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -74,8 +74,7 @@ int main(int argc, char* argv[]) {
|
|
|
|
|
input = input_data(cin, true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
auto in = input_data(cin, true);
|
|
|
|
|
auto bins = make_histogram(in.numbers, in.bin_count);
|
|
|
|
|
auto bins = make_histogram(input.numbers, input.bin_count);
|
|
|
|
|
show_histogram_svg(bins);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|