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