(new) code: Добавлен универсальный поток для чтения
Этот коммит содержится в:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user