using namespace std; #include "histogram.h" #include "text.h" #include "svg.h" //313 struct Input { std::vector numbers; size_t bin_count{}; }; Input input_data(istream& in, bool promt); int main() { Input in = input_data(cin,true); std::vector bins = make_histogram(in.numbers, in.bin_count); show_histogram_svg(bins); return 0; } Input input_data(istream& in, bool promt) { Input input_struct; size_t countOfNumbers; if(promt){cerr << "Input your count of numbers:\n";} cin >> countOfNumbers; input_struct.numbers.resize(countOfNumbers); if(promt){cerr << "Input numbers:\n";} for (int i = 0; i < countOfNumbers; i++) { if(promt){cerr << i << ":" << endl;} cin >> input_struct.numbers[i]; } if(promt){ cerr << endl; cerr << "Input bin count:\n"; } cin >> input_struct.bin_count; return input_struct; }