Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

58 строки
1.3 KiB
C++

#include <iostream>
#include <vector>
#include "histogram.h"
#include "text.h"
#include "svg.h"
#include <string>
#include <curl/curl.h>
using namespace std;
struct Input {
vector<double> numbers;
size_t bin_count{};
string stroke;
string fill;
};
Input
input_data(istream& Newcin){
size_t number_count;
cerr << "Enter number count: ";
Newcin >> number_count;
bool prompt;
cerr << "Do you want any prompts? Enter 'true' if yes, 'false' if no: ";
Newcin >> prompt;
if (prompt){
cerr << "Prompt";
}
Input in;
in.numbers.resize(number_count);
cerr << "Enter numbers: ";
for (size_t i = 0; i < number_count; i++) {
Newcin >> in.numbers[i];
}
cerr << "Enter bin count: ";
Newcin >> in.bin_count;
cerr << "Enter stroke in format RGB: ";
Newcin >> in.stroke;
cerr << "Enter fill in format RGB: ";
Newcin >> in.fill;
return in;
}
int
main(int argc, char* argv[]) {
if (argc > 1) {
for (int x = 0; x > argc; x++) {
cerr << "argv[" << x << "] = " << argv[x];
}
return 0;
}
curl_global_init(CURL_GLOBAL_ALL);
auto in = input_data(cin);
auto bins = make_histogram(in.numbers, in.bin_count);
show_histogram_svg(bins, in.stroke, in.fill);
}