build: Добавлена библиотека curl и решены проблемы при запуске программы

master
IvanonVG 7 дней назад
Родитель 3e7b5fd15a
Сommit d7f7df5a31

1
.gitignore поставляемый

@ -1,5 +1,6 @@
bin/ bin/
obj/ obj/
curl/
*.cbp *.cbp
*.layout *.layout
*.depend *.depend

@ -1,10 +1,6 @@
#ifndef HISTOGRAM_INTERNAL_H_INCLUDED #ifndef HISTOGRAM_INTERNAL_H_INCLUDED
#define HISTOGRAM_INTERNAL_H_INCLUDED #define HISTOGRAM_INTERNAL_H_INCLUDED
#include <vector>
void find_minmax(const std::vector<double>& numbers, double& min, double& max); void find_minmax(const std::vector<double>& numbers, double& min, double& max);
double calculate_average_height(const std::vector<size_t>& bins);
#endif // HISTOGRAM_INTERNAL_H_INCLUDED #endif // HISTOGRAM_INTERNAL_H_INCLUDED

@ -3,6 +3,8 @@
#include "histogram.h" #include "histogram.h"
#include "text.h" #include "text.h"
#include "svg.h" #include "svg.h"
#include <curl/curl.h>
using namespace std; using namespace std;
struct Input { struct Input {
@ -10,18 +12,24 @@ struct Input {
size_t bin_count; size_t bin_count;
}; };
Input input_data(istream& in) { Input input_data(istream& in, bool prompt) {
Input inp; Input inp;
size_t number_count; size_t number_count;
cerr << "Enter number count: "; if (prompt){
cerr << "Enter number count: ";
}
cin >> number_count; cin >> number_count;
inp.numbers.resize(number_count); inp.numbers.resize(number_count);
cerr << "Enter numbers: "; if (prompt){
cerr << "Enter numbers: ";
}
for (size_t i = 0; i < number_count; i++) { for (size_t i = 0; i < number_count; i++) {
cin >> inp.numbers[i]; cin >> inp.numbers[i];
} }
cerr << "Enter bin count: "; if (prompt) {
cerr << "Enter bin count: ";
}
cin >> inp.bin_count; cin >> inp.bin_count;
return inp; return inp;
} }
@ -29,7 +37,8 @@ Input input_data(istream& in) {
int main() { 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); auto bins = make_histogram(in.numbers, in.bin_count);
show_histogram_svg(bins); show_histogram_svg(bins);
return 0; return 0;

Загрузка…
Отмена
Сохранить