Этот коммит содержится в:
2023-05-15 14:29:54 +03:00
родитель e12d1715b0
Коммит d85dbcfea3

Просмотреть файл

@@ -13,18 +13,23 @@ struct Input
};
Input
input_data(istream& in)
input_data(istream& in, bool prompt)
{
if(prompt)
cerr << "vvedite col-vo nomerov:";
size_t number_count;
in >> number_count;
Input rez;
if(prompt)
cerr << "vvedite nomera:";
rez.numbers.resize(number_count);
for (size_t i = 0; i < number_count; i++)
{
in >> rez.numbers[i];
}
if(prompt)
cerr << "vvedite col-vo corzin:";
in >> rez.bin_count;
return rez;
}
@@ -32,7 +37,8 @@ input_data(istream& in)
int
main()
{
auto in = input_data(cin);
bool prompt = false;
auto in = input_data(cin, prompt);
auto bins = make_histogram(in.numbers, in.bin_count);
//show_histogram_svg(bins);
show_histogram_text(bins, in.numbers, in.bin_count);