|
|
@ -19,7 +19,8 @@ Input input_data(istream& inp, bool prompt)
|
|
|
|
Input in;
|
|
|
|
Input in;
|
|
|
|
size_t number_count;
|
|
|
|
size_t number_count;
|
|
|
|
|
|
|
|
|
|
|
|
if(prompt){
|
|
|
|
if(prompt)
|
|
|
|
|
|
|
|
{
|
|
|
|
cerr << "Enter number_count: ";
|
|
|
|
cerr << "Enter number_count: ";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
inp >> number_count;
|
|
|
|
inp >> number_count;
|
|
|
@ -31,24 +32,42 @@ Input input_data(istream& inp, bool prompt)
|
|
|
|
inp >> in.numbers[i];
|
|
|
|
inp >> in.numbers[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(prompt){
|
|
|
|
if(prompt)
|
|
|
|
|
|
|
|
{
|
|
|
|
cerr << "Enter bin_count: ";
|
|
|
|
cerr << "Enter bin_count: ";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
inp >> in.bin_count;
|
|
|
|
inp >> in.bin_count;
|
|
|
|
|
|
|
|
|
|
|
|
in.colors.resize(in.bin_count);
|
|
|
|
in.colors.resize(in.bin_count);
|
|
|
|
cerr << "Enter colors: ";
|
|
|
|
cerr << "Enter colors: ";
|
|
|
|
for (size_t i = 0; i < in.bin_count; i++) {
|
|
|
|
for (size_t i = 0; i < in.bin_count; i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
inp >> in.colors[i];
|
|
|
|
inp >> in.colors[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return in;
|
|
|
|
return in;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int main()
|
|
|
|
int main(int argc, char* argv[])
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (argc > 1)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
CURL* curl = curl_easy_init();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(curl)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
CURLcode res;
|
|
|
|
|
|
|
|
curl_easy_setopt(curl, CURLOPT_URL, argv[1]);
|
|
|
|
|
|
|
|
res = curl_easy_perform(curl);
|
|
|
|
|
|
|
|
curl_easy_cleanup(curl);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
curl_global_init(CURL_GLOBAL_ALL);
|
|
|
|
curl_global_init(CURL_GLOBAL_ALL);
|
|
|
|
|
|
|
|
|
|
|
|
auto in = input_data(cin, true);
|
|
|
|
auto in = input_data(cin, true);
|
|
|
|
auto bins = make_histogram(in.numbers, in.bin_count);
|
|
|
|
auto bins = make_histogram(in.numbers, in.bin_count);
|
|
|
|
show_histogram_svg(bins, in.colors);
|
|
|
|
show_histogram_svg(bins, in.colors);
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|