code: ЛР4 вариант 2(исправленный)
Этот коммит содержится в:
24
main.cpp
24
main.cpp
@@ -85,12 +85,32 @@ int main( int argc, char* argv[]){
|
|||||||
auto bins = make_histogram(input.numbers, input.bin_count);
|
auto bins = make_histogram(input.numbers, input.bin_count);
|
||||||
show_histogram_text(bins, input.bin_count);
|
show_histogram_text(bins, input.bin_count);
|
||||||
}else{
|
}else{
|
||||||
cerr << "wrong type, choose format 'svg' or 'txt'";
|
cerr << "wrong type, choose format 'svg' or 'txt'" << endl;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
cerr << "type '-format' to choose output format";
|
cerr << "type '-format' to choose output format" << endl;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if ((format=argv[2])== "-format"){
|
||||||
|
if ((type=argv[3])== "svg"){
|
||||||
|
input = download(argv[3]);
|
||||||
|
const auto bins = make_histogram(input.numbers, input.bin_count);
|
||||||
|
show_histogram_svg(bins);
|
||||||
|
}else if ((type=argv[3])== "text"){
|
||||||
|
input = download(argv[3]);
|
||||||
|
auto bins = make_histogram(input.numbers, input.bin_count);
|
||||||
|
show_histogram_text(bins, input.bin_count);
|
||||||
|
}else{
|
||||||
|
cerr << "wrong type, choose format 'svg' or 'txt'" << endl;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
cerr << "type '-format' to choose output format" << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
input = input_data(cin, true);
|
||||||
|
const auto bins = make_histogram(input.numbers, input.bin_count);
|
||||||
|
show_histogram_svg(bins);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user