Code: добавлена возможность выбирать нужно ли выводить в cerr подсказки
Этот коммит содержится в:
13
main.cpp
13
main.cpp
@@ -12,17 +12,24 @@ struct Input {
|
||||
|
||||
Input
|
||||
input_data(istream& stream){
|
||||
bool prompt = true;
|
||||
size_t number_count;
|
||||
cerr << "Enter number count:" << endl;
|
||||
if (prompt){
|
||||
cerr << "Enter number count:" << endl;
|
||||
}
|
||||
stream >> number_count;
|
||||
Input in;
|
||||
in.numbers.resize(number_count);
|
||||
vector<double> numbers(number_count);
|
||||
cerr << "Enter numbers:" << endl;
|
||||
if (prompt){
|
||||
cerr << "Enter numbers:" << endl;
|
||||
}
|
||||
for (size_t i = 0; i < number_count; i++) {
|
||||
stream >> in.numbers[i];
|
||||
}
|
||||
cerr << "Enter bin count:" << endl;
|
||||
if (prompt){
|
||||
cerr << "Enter bin count:" << endl;
|
||||
}
|
||||
stream >> in.bin_count;
|
||||
return in;
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user