diff --git a/main.cpp b/main.cpp index 177c8db..4e8020a 100644 --- a/main.cpp +++ b/main.cpp @@ -15,16 +15,20 @@ struct Input size_t bin_count{}; }; -Input input_data(istream& stream) +Input input_data(istream& stream, bool prompt) { size_t number_count; - cerr << "Enter number count:"; + if (prompt){ + cerr << "Enter number count:"; + } stream >> number_count; Input in; in.numbers.resize(number_count); - cerr << "Enter numbers: "; + if (prompt){ + cerr << "Enter numbers: "; + } for(size_t i = 0; i < number_count; i++) stream >> in.numbers[i]; @@ -37,10 +41,11 @@ Input input_data(istream& stream) 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_vertical(bins); + // show_histogram_svg_vertical(bins); show_histogram_svg(bins); }