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 <curl/curl.h> + #include "histogram.h" #include "text.h" #include "svg.h" + struct Input { vector<double> 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); }