code: добавление параметра bool prompt

master
ArtyushinaVV 2 лет назад
Родитель 3e31671e2d
Сommit 5f41788050

@ -15,32 +15,34 @@ struct Input
};
Input
input_data(istream& in)
input_data(istream& in, bool prompt)
{
if(prompt)
cerr << "count=";
size_t number_count;
cerr << "count=";
in >> number_count;
Input rez;
if(prompt)
cerr << "bin_count= ";
rez.numbers.resize(number_count);
for (size_t i = 0; i < number_count; i++)
{
in >> rez.numbers[i];
}
cerr << "bin_count= ";
if(prompt)
cerr << "bin_count= ";
in >> rez.bin_count;
return rez;
}
int main()
{
auto in = input_data(cin);
bool prompt = true;
auto in = input_data(cin, prompt);
auto bins = make_histogram(in.numbers, in.bin_count);
show_histogram_svg(bins);
return 0;

Загрузка…
Отмена
Сохранить