Сравнить коммиты

...

3 Коммитов

Автор SHA1 Сообщение Дата
77874d3b68 с божьей помощью подключили curl 2025-05-19 12:18:46 +03:00
aa518e1fed promt 2025-05-16 11:59:17 +03:00
dcb3401ade cin меняем на in 2025-05-16 11:51:45 +03:00

Просмотреть файл

@@ -1,25 +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() { Input input_data(istream& in, bool promt = false) {
Input in; Input lin;
size_t n, korz; size_t n, korz;
if(promt)
cerr << "Number of elem "; cerr << "Number of elem ";
cin >> n; in >> n;
in.vec.resize(n); lin.vec.resize(n);
for (size_t i = 0; i < n; i++) for (size_t i = 0; i < n; i++)
cin >> in.vec[i]; in >> lin.vec[i];
cerr << "Enter bin count: "; if(promt)
cin >> in.korz; cerr << "Enter bin count: ";
return in; in >> lin.korz;
return lin;
} }
int main() { int main() {
auto in = input_data(); curl_global_init(CURL_GLOBAL_ALL);
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);
} }