|
|
|
@ -75,46 +75,36 @@ download(const string& address)
|
|
|
|
|
|
|
|
|
|
int main(int argc, char* argv[])
|
|
|
|
|
{
|
|
|
|
|
Input input;
|
|
|
|
|
Input input;
|
|
|
|
|
if (argc > 1)
|
|
|
|
|
{
|
|
|
|
|
input = download(argv[3]);
|
|
|
|
|
int bins_cnt = atoi(argv[2]);
|
|
|
|
|
string check = typeid(atoi(argv[2])).name();
|
|
|
|
|
if(check != "int"){
|
|
|
|
|
cout << "Ââåäèòå ÷èñëî ïîñëå -bins";
|
|
|
|
|
return 0;
|
|
|
|
|
int bins_cnt = 0;
|
|
|
|
|
for (int i = 1; i < argc; i++) {
|
|
|
|
|
string arg = argv[i];
|
|
|
|
|
if (arg == "-bins") {
|
|
|
|
|
if (i + 1 < argc) {
|
|
|
|
|
bins_cnt = stoi(argv[i+1]);
|
|
|
|
|
if(i + 2 < argc){
|
|
|
|
|
input = download(argv[i+2]);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
input = download(argv[i-1]);
|
|
|
|
|
}
|
|
|
|
|
i++;
|
|
|
|
|
} else {
|
|
|
|
|
cout << "Missing argument value for -bins option" << endl;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const auto bins = make_histogram(input.numbers, bins_cnt);
|
|
|
|
|
show_histogram_svg(bins);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
input = input_data(cin, true);
|
|
|
|
|
const auto bins = make_histogram(input.numbers, input.bin_count);
|
|
|
|
|
show_histogram_svg(bins);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//const auto bins = make_histogram(input.numbers, input.bin_count);
|
|
|
|
|
}
|
|
|
|
|
/*
|
|
|
|
|
int main(int argc, char* argv[])
|
|
|
|
|
{
|
|
|
|
|
Input input;
|
|
|
|
|
if (argc > 1)
|
|
|
|
|
{
|
|
|
|
|
int bins_cnt = atoi(argv[2]);
|
|
|
|
|
input = download(argv[3]);
|
|
|
|
|
const auto bins = make_histogram(input.numbers, bins_cnt);
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
input = input_data(cin, true);
|
|
|
|
|
const auto bins = make_histogram(input.numbers, input.bin_count);
|
|
|
|
|
show_histogram_svg(bins);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|