From 6fa4cab269417524d66a2e478590bdf0077cbc81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B0=D1=88=D0=B5=20=D0=98=D0=BC=D1=8F?= Date: Sat, 3 Jun 2023 19:52:57 +0300 Subject: [PATCH] =?UTF-8?q?code:=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D0=B2=D0=B2=D0=BE=D0=B4=20=D1=87=D0=B5=D1=80?= =?UTF-8?q?=D0=B5=D0=B7=20=D0=BF=D0=B5=D1=80=D0=B2=D1=8B=D0=B9=20=D0=B0?= =?UTF-8?q?=D1=80=D0=B3=D1=83=D0=BC=D0=B5=D0=BD=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/main.cpp b/main.cpp index 9ca1644..63509f4 100755 --- a/main.cpp +++ b/main.cpp @@ -52,16 +52,19 @@ input_data(istream& in, bool prompt) { } -int main(int argc, char* argv[]) { - +int +main(int argc, char* argv[]) { if (argc > 1) { - for (int i = 0; i < argc; ++i) { - cerr << "argv[" << i << "] = " << argv[i] << endl; + 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; } - return 0; - curl_global_init(CURL_GLOBAL_ALL); auto in = input_data(cin, true); //input data auto bins = make_histogram(in.numbers, in.bin_count); //calculating bin size for the histogram