victoriaCS 2 месяцев назад
Родитель d09f433463
Сommit 38bc82e2ae

@ -1,29 +1,44 @@
#include <curl/curl.h>
#define CURL_STATICLIB
#include <iostream>
#include <vector>
#include "histogram.h"
#include "text.h"
#include <string>
#include <algorithm>
#include <sstream>
#include <curl/curl.h>
#include <sstream>
#include "hictogram.h"
#include "svg.h"
int main(int argc, char* argv[]) {
if (argc > 1) {
cout << "argc = " << argc << endl;
for (int i = 0; i < argc; ++i) {
cout << "argv[" << i << "] = \"" << argv[i] << "\"" << endl;
}
return 0;
}
using namespace std;
struct Input {
vector<double> numbers;
size_t bin_count{};
};
Input input_data(istream& in) {
size_t number_count;
in >> number_count;
Input input;
input.numbers.resize(number_count);
CURLcode res = curl_global_init(CURL_GLOBAL_ALL);
if (res != CURLE_OK) {
cerr << "cURL initialization failed: " << curl_easy_strerror(res) << endl;
return 1;
for (size_t i = 0; i < number_count; i++) {
in >> input.numbers[i];
}
auto in = input_data();
auto bins = make_histogram(in.numbers, in.bin_count);
show_histogram_svg(bins, in.block_width);
in >> input.bin_count;
curl_global_cleanup();
return input;
}
int main() {
Input input;
const auto bins = make_histogram(input.numbers, input.bin_count);
show_histogram_svg(bins);
return 0;
}

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