Сравнить коммиты
4 Коммитов
master
...
d09f433463
| Автор | SHA1 | Дата | |
|---|---|---|---|
|
|
d09f433463 | ||
|
|
a6e1bddfff | ||
|
|
b2da1775b1 | ||
|
|
b7e2e9af42 |
43
main.cpp
43
main.cpp
@@ -1,36 +1,29 @@
|
||||
#include <curl/curl.h>
|
||||
#define CURL_STATICLIB
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include "histogram.h"
|
||||
#include "text.h"
|
||||
#include "svg.h"
|
||||
#include "hictogram.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
struct Input {
|
||||
vector<double> numbers;
|
||||
size_t bin_count{};
|
||||
};
|
||||
|
||||
Input input_data() {
|
||||
size_t number_count;
|
||||
cerr << "Enter number count: ";
|
||||
cin >> number_count;
|
||||
|
||||
Input in;
|
||||
in.numbers.resize(number_count);
|
||||
|
||||
for (size_t i = 0; i < number_count; i++) {
|
||||
cin >> 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;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
cerr << "Enter bin count: ";
|
||||
cin >> in.bin_count;
|
||||
|
||||
return in;
|
||||
CURLcode res = curl_global_init(CURL_GLOBAL_ALL);
|
||||
if (res != CURLE_OK) {
|
||||
cerr << "cURL initialization failed: " << curl_easy_strerror(res) << endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int main() {
|
||||
auto in = input_data();
|
||||
auto bins = make_histogram(in.numbers, in.bin_count);
|
||||
show_histogram_svg(bins);
|
||||
}
|
||||
show_histogram_svg(bins, in.block_width);
|
||||
|
||||
curl_global_cleanup();
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user