#include #include #include #include #include #include "histogram.h" #include "text.h" #include "svg.h" const size_t WINDOW_WIDTH = 80; const size_t MAX_VALUE = WINDOW_WIDTH - 3 - 1; using namespace std; struct Input{ vector numbers; size_t bin_count = 0; }; Input input_data(istream &thread, bool &prompt){ //произошла накладка с именами переменных: при названии потока in ругается на с22, в которой якобы объявляется аргумент size_t number_count; if (prompt) {cerr << "Enter the amount of numbers: " << endl;} cin >> number_count; Input in; in.numbers.resize(number_count); if (prompt) {cerr << "Enter the numbers: " << endl;} for (size_t i = 0; i < number_count; i++) { cin >> in.numbers[i]; } if (prompt) {cerr << "Enter the amount of bins: " << endl;} cin >> in.bin_count; return in; } int main(){ double min = 0, max = 0; size_t font = 0; bool prompt = false; auto in = input_data(cin, prompt); auto bins = make_histogram(in.numbers, in.bin_count); //for (auto now: bins) {cout << now << endl;} cin >> font; if (font < 8) {(cerr << font << "Font value is too small. Please, edit the input file.");} else if (font > 32) {(cerr << "Font value is too large. Please, edit the input file.");} else {show_histogram_svg(bins, font);} return 0; } //с клавиатуры в marks.txt, с marks.txt в marks.svg