|
|
|
@ -1,45 +1,20 @@
|
|
|
|
|
#include <curl/curl.h>
|
|
|
|
|
#define CURL_STATICLIB
|
|
|
|
|
#include <iostream>
|
|
|
|
|
#include <vector>
|
|
|
|
|
#include "histogram.h"
|
|
|
|
|
#include "text.h"
|
|
|
|
|
#include "svg.h"
|
|
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
|
struct Input {
|
|
|
|
|
vector<double> numbers;
|
|
|
|
|
size_t bin_count{};
|
|
|
|
|
size_t block_width{};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Input input_data(istream& in_stream = cin, bool prompt = true) {
|
|
|
|
|
Input in;
|
|
|
|
|
size_t number_count;
|
|
|
|
|
|
|
|
|
|
if (prompt) {
|
|
|
|
|
cerr << "Enter number count: ";
|
|
|
|
|
}
|
|
|
|
|
in_stream >> number_count;
|
|
|
|
|
|
|
|
|
|
in.numbers.resize(number_count);
|
|
|
|
|
|
|
|
|
|
if (prompt) {
|
|
|
|
|
cerr << "Enter " << number_count << " numbers: ";
|
|
|
|
|
}
|
|
|
|
|
for (size_t i = 0; i < number_count; i++) {
|
|
|
|
|
in_stream >> in.numbers[i];
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (prompt) {
|
|
|
|
|
cerr << "Enter bin count: ";
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
in_stream >> in.bin_count;
|
|
|
|
|
|
|
|
|
|
return in;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
|
CURLcode res = curl_global_init(CURL_GLOBAL_ALL);
|
|
|
|
|
if (res != CURLE_OK) {
|
|
|
|
|
cerr << "cURL initialization failed: " << curl_easy_strerror(res) << endl;
|
|
|
|
|