From 518ab2b6b504c2a019cff87b60e96ea18b4dd040 Mon Sep 17 00:00:00 2001 From: LatyshevGI Date: Thu, 22 May 2025 22:01:24 +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=20curl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + main.cpp | 17 +++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 95c1f92..925f687 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /main.o /main.exe /unittest.layout +/curl diff --git a/main.cpp b/main.cpp index 2a0f3c2..fe31698 100644 --- a/main.cpp +++ b/main.cpp @@ -1,30 +1,31 @@ +#include + #include "histogram.h" #include "text.h" #include "svg.h" + struct Input { vector vec; size_t korz{}; }; - -Input input_data(istream& in, bool prompt = false) { +Input input_data(istream& in, bool promt = false) { Input lin; size_t n, korz; - if(prompt) - cerr << "Number of elements: "; + if(promt) + cerr << "Number of elem "; in >> n; lin.vec.resize(n); for (size_t i = 0; i < n; i++) in >> lin.vec[i]; - if(prompt) + if(promt) cerr << "Enter bin count: "; in >> lin.korz; return lin; } - int main() { - - auto in = input_data(cin, true); + curl_global_init(CURL_GLOBAL_ALL); + auto in = input_data(cin); auto bins = make_histogram(in.korz, in.vec); show_histogram_svg(bins); }