|
|
@ -12,18 +12,27 @@ struct Input {
|
|
|
|
size_t block_width{};
|
|
|
|
size_t block_width{};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
Input input_data(istream& in_steam = cin) {
|
|
|
|
Input input_data(istream& in_steam = cin, bool prompt = true) {
|
|
|
|
cerr << "Enter number count: ";
|
|
|
|
size_t number_count;
|
|
|
|
cin >> number_count;
|
|
|
|
if (prompt) {
|
|
|
|
|
|
|
|
cerr << "Enter number count: ";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
in_steam >> number_count;
|
|
|
|
|
|
|
|
|
|
|
|
Input in;
|
|
|
|
Input in;
|
|
|
|
in.numbers.resize(number_count);
|
|
|
|
in.numbers.resize(number_count);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (prompt) {
|
|
|
|
|
|
|
|
cerr << "Enter " << number_count << " numbers: ";
|
|
|
|
|
|
|
|
}
|
|
|
|
for (size_t i = 0; i < number_count; i++) {
|
|
|
|
for (size_t i = 0; i < number_count; i++) {
|
|
|
|
cin >> in.numbers[i];
|
|
|
|
in_stream >> in.numbers[i];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (prompt) {
|
|
|
|
|
|
|
|
cerr << "Enter bin count: ";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
cerr << "Enter bin count: ";
|
|
|
|
in_stream >> in.bin_count;
|
|
|
|
cin >> in.bin_count;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return in;
|
|
|
|
return in;
|
|
|
|
}
|
|
|
|
}
|
|
|
|