|
|
|
@ -14,9 +14,15 @@ struct Input
|
|
|
|
|
Input
|
|
|
|
|
input_data(istream& inn)
|
|
|
|
|
{
|
|
|
|
|
bool prompt;
|
|
|
|
|
int value;
|
|
|
|
|
cerr << "Show messages? (0 - no \ 1- yes)";
|
|
|
|
|
inn >> value;
|
|
|
|
|
prompt = value;
|
|
|
|
|
|
|
|
|
|
Input in;
|
|
|
|
|
size_t number_count;
|
|
|
|
|
cerr << "Enter number count: ";
|
|
|
|
|
if (prompt) cerr << "Enter number count: ";
|
|
|
|
|
inn >> number_count;
|
|
|
|
|
|
|
|
|
|
in.numbers.resize(number_count);
|
|
|
|
@ -24,12 +30,12 @@ input_data(istream& inn)
|
|
|
|
|
|
|
|
|
|
for (size_t i = 0; i < number_count; i++)
|
|
|
|
|
{
|
|
|
|
|
cerr << "Enter numbers: ";
|
|
|
|
|
cin >> in.numbers[i];
|
|
|
|
|
if (prompt) cerr << "Enter numbers: ";
|
|
|
|
|
inn >> in.numbers[i];
|
|
|
|
|
}
|
|
|
|
|
size_t bin_count;
|
|
|
|
|
cerr << "Enter bin count: ";
|
|
|
|
|
cin >> in.bin_count;
|
|
|
|
|
if (prompt) cerr << "Enter bin count: ";
|
|
|
|
|
inn >> in.bin_count;
|
|
|
|
|
return in;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|