Вы не можете выбрать более 25 тем
Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
50 строки
1.0 KiB
C++
50 строки
1.0 KiB
C++
#include <iostream>
|
|
#include <vector>
|
|
#include "histogram.h"
|
|
#include "text.h"
|
|
#include "svg.h"
|
|
#include <string>
|
|
|
|
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() {
|
|
auto in = input_data(cin);
|
|
auto bins = make_histogram(in.numbers, in.bin_count);
|
|
show_histogram_svg(bins, in.stroke, in.fill);
|
|
}
|