Сравнить коммиты
2 Коммитов
d09f433463
...
master
| Автор | SHA1 | Дата | |
|---|---|---|---|
|
|
85277aaf0c | ||
|
|
689ac0417f |
49
main.cpp
49
main.cpp
@@ -1,29 +1,40 @@
|
|||||||
#include <curl/curl.h>
|
|
||||||
#define CURL_STATICLIB
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "histogram.h"
|
|
||||||
#include "text.h"
|
|
||||||
#include "svg.h"
|
#include "svg.h"
|
||||||
|
#include "hictogram.h"
|
||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
using namespace std;
|
||||||
if (argc > 1) {
|
|
||||||
cout << "argc = " << argc << endl;
|
struct Input {
|
||||||
for (int i = 0; i < argc; ++i) {
|
vector<double> numbers;
|
||||||
cout << "argv[" << i << "] = \"" << argv[i] << "\"" << endl;
|
size_t bin_count{};
|
||||||
|
};
|
||||||
|
|
||||||
|
Input input_data(istream& in, bool prompt) {
|
||||||
|
size_t number_count;
|
||||||
|
if (prompt){
|
||||||
|
cerr << "Enter number count: "
|
||||||
}
|
}
|
||||||
return 0;
|
in >> number_count;
|
||||||
|
|
||||||
|
Input in_data;
|
||||||
|
in_data.numbers.resize(number_count);
|
||||||
|
|
||||||
|
for (size_t i = 0; i < number_count; i++) {
|
||||||
|
in >> in_data.numbers[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
CURLcode res = curl_global_init(CURL_GLOBAL_ALL);
|
if (prompt){
|
||||||
if (res != CURLE_OK) {
|
cer << "Enter bin count: "
|
||||||
cerr << "cURL initialization failed: " << curl_easy_strerror(res) << endl;
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
in >> in_data.bin_count;
|
||||||
|
|
||||||
auto in = input_data();
|
return in_data;
|
||||||
auto bins = make_histogram(in.numbers, in.bin_count);
|
|
||||||
show_histogram_svg(bins, in.block_width);
|
|
||||||
|
|
||||||
curl_global_cleanup();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
auto in = input_data(cin, true);
|
||||||
|
auto bins = make_histogram(in.numbers, in.bin_count);
|
||||||
|
show_histogram_svg(bins);
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user