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