build: Добавлена библиотека curl и решены проблемы при запуске программы
Этот коммит содержится в:
1
.gitignore
поставляемый
1
.gitignore
поставляемый
@@ -1,5 +1,6 @@
|
||||
bin/
|
||||
obj/
|
||||
curl/
|
||||
*.cbp
|
||||
*.layout
|
||||
*.depend
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
#ifndef HISTOGRAM_INTERNAL_H_INCLUDED
|
||||
#define HISTOGRAM_INTERNAL_H_INCLUDED
|
||||
|
||||
#include <vector>
|
||||
|
||||
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
|
||||
|
||||
19
main.cpp
19
main.cpp
@@ -3,6 +3,8 @@
|
||||
#include "histogram.h"
|
||||
#include "text.h"
|
||||
#include "svg.h"
|
||||
#include <curl/curl.h>
|
||||
|
||||
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;
|
||||
|
||||
Ссылка в новой задаче
Block a user