From 66c067f29122da2400761504d6ed77b47ff840ba Mon Sep 17 00:00:00 2001 From: "Alice (VasinaEY)" Date: Sun, 1 Jun 2025 22:15:16 +0300 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=BA?= =?UTF-8?q?=D0=B0=20=D1=84=D0=B0=D0=B9=D0=BB=D0=B0=20=D0=BF=D0=BE=20=D1=81?= =?UTF-8?q?=D0=B5=D1=82=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/main.cpp b/main.cpp index ab5785a..fcc66bf 100644 --- a/main.cpp +++ b/main.cpp @@ -5,31 +5,37 @@ #include "text.h" #include "svg.h" -struct Input { +struct Input +{ std::vector numbers; size_t bin_count{}; }; -Input input_data(std::istream& in, bool prompt) { +Input input_data(std::istream& in, bool prompt) +{ Input data; size_t number_count; - if(prompt){ - cerr << "Enter the number of elements: "; + if(prompt) + { + cerr << "Enter the number of elements: "; } in >> number_count; data.numbers.resize(number_count); - if(prompt){ - cerr << "\nEnter " << number_count << " elements:" << endl; + if(prompt) + { + cerr << "\nEnter " << number_count << " elements:" << endl; } - for (size_t i = 0; i < number_count; i++) { + for (size_t i = 0; i < number_count; i++) + { in >> data.numbers[i]; } - if(prompt){ - cerr << "Enter the number of bins: "; + if(prompt) + { + cerr << "Enter the number of bins: "; } in >> data.bin_count; @@ -44,12 +50,16 @@ int main(int argc, char* argv[]) if (argc > 1) { - cout << "argc = " << argc << endl; - for (int i = 0; i < argc; ++i) + const char *url = argv[1]; + + CURL *curl = curl_easy_init(); + if (curl) { - cout << "argv[" << i << "] = " << argv[i] << endl; + curl_easy_setopt(curl, CURLOPT_URL, url); + curl_easy_perform(curl); + curl_easy_cleanup(curl); + return 0; } - return 0; } auto in = input_data(cin,true);