|
|
|
@ -13,28 +13,28 @@ struct Input {
|
|
|
|
|
double USER_BIN_HEIGHT{};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Input input_data() {
|
|
|
|
|
Input input_data(istream& stream) {
|
|
|
|
|
|
|
|
|
|
size_t number_count;
|
|
|
|
|
|
|
|
|
|
cerr << "Enter number count: ";
|
|
|
|
|
cin >> number_count;
|
|
|
|
|
stream >> number_count;
|
|
|
|
|
|
|
|
|
|
Input in;
|
|
|
|
|
|
|
|
|
|
cerr << "Enter number of bins: ";
|
|
|
|
|
cin >> in.bin_count;
|
|
|
|
|
stream >> in.bin_count;
|
|
|
|
|
|
|
|
|
|
in.numbers.resize(number_count);
|
|
|
|
|
|
|
|
|
|
cerr << "Enter numbers: ";
|
|
|
|
|
for (size_t i = 0; i < number_count; i++)
|
|
|
|
|
{
|
|
|
|
|
cin >> in.numbers[i];
|
|
|
|
|
stream >> in.numbers[i];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cerr << "Enter image height: ";
|
|
|
|
|
cin >> in.USER_BIN_HEIGHT;
|
|
|
|
|
stream >> in.USER_BIN_HEIGHT;
|
|
|
|
|
|
|
|
|
|
return in;
|
|
|
|
|
}
|
|
|
|
@ -44,9 +44,7 @@ Input input_data() {
|
|
|
|
|
|
|
|
|
|
int main(){
|
|
|
|
|
|
|
|
|
|
bool res = false;
|
|
|
|
|
|
|
|
|
|
Input in = input_data();
|
|
|
|
|
Input in = input_data(cin);
|
|
|
|
|
|
|
|
|
|
auto bins = make_histogram(in.numbers, in.bin_count);
|
|
|
|
|
|
|
|
|
|