main
LatyshevGI 2 недель назад
Родитель dfe74bcb26
Сommit 518ab2b6b5

1
.gitignore поставляемый

@ -5,3 +5,4 @@
/main.o /main.o
/main.exe /main.exe
/unittest.layout /unittest.layout
/curl

@ -1,30 +1,31 @@
#include <curl/curl.h>
#include "histogram.h" #include "histogram.h"
#include "text.h" #include "text.h"
#include "svg.h" #include "svg.h"
struct Input { struct Input {
vector<double> vec; vector<double> vec;
size_t korz{}; size_t korz{};
}; };
Input input_data(istream& in, bool promt = false) {
Input input_data(istream& in, bool prompt = false) {
Input lin; Input lin;
size_t n, korz; size_t n, korz;
if(prompt) if(promt)
cerr << "Number of elements: "; cerr << "Number of elem ";
in >> n; in >> n;
lin.vec.resize(n); lin.vec.resize(n);
for (size_t i = 0; i < n; i++) for (size_t i = 0; i < n; i++)
in >> lin.vec[i]; in >> lin.vec[i];
if(prompt) if(promt)
cerr << "Enter bin count: "; cerr << "Enter bin count: ";
in >> lin.korz; in >> lin.korz;
return lin; return lin;
} }
int main() { int main() {
curl_global_init(CURL_GLOBAL_ALL);
auto in = input_data(cin, true); auto in = input_data(cin);
auto bins = make_histogram(in.korz, in.vec); auto bins = make_histogram(in.korz, in.vec);
show_histogram_svg(bins); show_histogram_svg(bins);
} }

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