From d7f7df5a316f196bd78533751f637b222e6002ca Mon Sep 17 00:00:00 2001 From: IvanonVG Date: Sat, 24 May 2025 22:18:19 +0300 Subject: [PATCH] =?UTF-8?q?build:=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=B1=D0=B8=D0=B1=D0=BB=D0=B8=D0=BE=D1=82?= =?UTF-8?q?=D0=B5=D0=BA=D0=B0=20curl=20=D0=B8=20=D1=80=D0=B5=D1=88=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D0=BF=D1=80=D0=BE=D0=B1=D0=BB=D0=B5=D0=BC=D1=8B?= =?UTF-8?q?=20=D0=BF=D1=80=D0=B8=20=D0=B7=D0=B0=D0=BF=D1=83=D1=81=D0=BA?= =?UTF-8?q?=D0=B5=20=D0=BF=D1=80=D0=BE=D0=B3=D1=80=D0=B0=D0=BC=D0=BC=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + histogram_internal.h | 4 ---- main.cpp | 19 ++++++++++++++----- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 1a85222..55d7157 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ bin/ obj/ +curl/ *.cbp *.layout *.depend diff --git a/histogram_internal.h b/histogram_internal.h index 0187157..945d37c 100644 --- a/histogram_internal.h +++ b/histogram_internal.h @@ -1,10 +1,6 @@ #ifndef HISTOGRAM_INTERNAL_H_INCLUDED #define HISTOGRAM_INTERNAL_H_INCLUDED -#include - void find_minmax(const std::vector& numbers, double& min, double& max); -double calculate_average_height(const std::vector& bins); - #endif // HISTOGRAM_INTERNAL_H_INCLUDED diff --git a/main.cpp b/main.cpp index 16b174a..986cec4 100644 --- a/main.cpp +++ b/main.cpp @@ -3,6 +3,8 @@ #include "histogram.h" #include "text.h" #include "svg.h" +#include + using namespace std; struct Input { @@ -10,18 +12,24 @@ struct Input { size_t bin_count; }; -Input input_data(istream& in) { +Input input_data(istream& in, bool prompt) { Input inp; size_t number_count; - cerr << "Enter number count: "; + if (prompt){ + cerr << "Enter number count: "; + } cin >> number_count; inp.numbers.resize(number_count); - cerr << "Enter numbers: "; + if (prompt){ + cerr << "Enter numbers: "; + } for (size_t i = 0; i < number_count; i++) { cin >> inp.numbers[i]; } - cerr << "Enter bin count: "; + if (prompt) { + cerr << "Enter bin count: "; + } cin >> inp.bin_count; return inp; } @@ -29,7 +37,8 @@ Input input_data(istream& in) { int main() { - auto in = input_data(cin); + curl_global_init(CURL_GLOBAL_ALL); + auto in = input_data(cin, true); auto bins = make_histogram(in.numbers, in.bin_count); show_histogram_svg(bins); return 0;