diff --git a/fin_lab34.cpp b/fin_lab34.cpp index b124c60..75f0990 100644 --- a/fin_lab34.cpp +++ b/fin_lab34.cpp @@ -16,7 +16,7 @@ struct Input{ }; Input -input_data(){ +input_data(istream &thread){ size_t number_count; cin >> number_count; Input in; @@ -32,11 +32,13 @@ int main(){ double min = 0, max = 0; size_t font = 0; - Input in = input_data(); + auto in = input_data(cin); auto bins = make_histogram(in.numbers, in.bin_count); //for (auto now: bins) {cout << now << endl;} cin >> font; - show_histogram_svg(bins, font); + if (font < 8) {cerr << "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; }