From 85eb559f722ab8fe6b716be3e65e03ed53580406 Mon Sep 17 00:00:00 2001 From: "Varvara (ZeninaVA)" Date: Wed, 21 May 2025 16:12:29 +0300 Subject: [PATCH] =?UTF-8?q?code:=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=20?= =?UTF-8?q?=D1=81=20curl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/main.cpp b/main.cpp index 92659eb..f4cf7f2 100644 --- a/main.cpp +++ b/main.cpp @@ -1,12 +1,13 @@ +#include #include #include "histogram.h" #include "text.h" #include "svg.h" -#include #include using namespace std; + struct Input { vector vec; size_t korz{}; @@ -25,8 +26,9 @@ Input input_data(istream &in, bool prompt) { if (prompt) { cerr << "Elements: "; } - for (size_t i = 0; i < n; i++) + for (size_t i = 0; i < n; i++) { in >> data.vec[i]; + } if (prompt) { cerr << "Enter bin count: "; @@ -36,18 +38,25 @@ Input input_data(istream &in, bool prompt) { return data; } + int main(int argc, char* argv[]) { curl_global_init(CURL_GLOBAL_ALL); if (argc > 1) { - cout << "argc = " << argc << endl; - for (int i = 0; i < argc; ++i) { - cout << "argv[" << i << "] = " << argv[i] << endl; + + const char *url = argv[1]; + + CURL *curl = curl_easy_init(); + if (curl) { + curl_easy_setopt(curl, CURLOPT_URL, url); + curl_easy_perform(curl); + curl_easy_cleanup(curl); } + return 0; } - auto in_with_prompt = input_data(cin, true); auto bins_with_prompt = make_histogram(in_with_prompt.korz, in_with_prompt.vec); show_histogram_svg(bins_with_prompt); -} + + return 0;