|
|
|
@ -32,12 +32,26 @@ Input input_data(istream& in_stream, bool prompt) {
|
|
|
|
|
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);
|
|
|
|
|
if (res != 0) {
|
|
|
|
|
cerr << curl_easy_strerror(res);
|
|
|
|
|
exit(1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
curl_easy_cleanup(curl);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
curl_global_init(CURL_GLOBAL_ALL);
|
|
|
|
|
const size_t SCREEN_WIDTH = 80;
|
|
|
|
|
const size_t MAX_ASTERISK = SCREEN_WIDTH - 3 - 1;
|
|
|
|
|
auto in = input_data(cin, true);
|
|
|
|
|
auto in = input_data(cin, false);
|
|
|
|
|
vector<double> numbers_data = in.numbers;
|
|
|
|
|
auto bins = make_histogram(in.numbers, in.bin_count);
|
|
|
|
|
show_histogram_svg(bins, in.numbers, in.bin_count);
|
|
|
|
|