добавлен bool prompt
Этот коммит содержится в:
8
main.cpp
8
main.cpp
@@ -12,7 +12,7 @@ struct Input {
|
||||
};
|
||||
|
||||
Input
|
||||
input_data(istream& in){
|
||||
input_data(istream& in, bool prompt){
|
||||
size_t number_count;
|
||||
cerr << "Enter number count: ";
|
||||
cin >> number_count;
|
||||
@@ -23,13 +23,15 @@ input_data(istream& in){
|
||||
cerr << "Enter Num[" << i << "]: ";
|
||||
cin >> inp.numbers[i];
|
||||
}
|
||||
cerr << "Enter bin count: ";
|
||||
if (prompt) {
|
||||
cerr << "Enter bin count: ";
|
||||
}
|
||||
cin >> inp.bin_count;
|
||||
return inp;
|
||||
}
|
||||
int main()
|
||||
{
|
||||
auto in = input_data(cin);
|
||||
auto in = input_data(cin, true);;
|
||||
auto bins = make_histogram(in.numbers, in.bin_count);
|
||||
show_histogram_svg(bins);
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user