|
|
|
@ -4,8 +4,6 @@
|
|
|
|
|
#include "svg.h"
|
|
|
|
|
#include "text.h"
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <curl/curl.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
@ -14,37 +12,26 @@ struct Input {
|
|
|
|
|
size_t bin_count{};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Input input_data(istream& in_stream, bool prompt) {
|
|
|
|
|
Input in;
|
|
|
|
|
Input input_data() {
|
|
|
|
|
size_t number_count;
|
|
|
|
|
cerr << "Enter number count: ";
|
|
|
|
|
cin >> number_count;
|
|
|
|
|
|
|
|
|
|
if (prompt) {
|
|
|
|
|
cerr << "Enter number count: ";
|
|
|
|
|
}
|
|
|
|
|
in_stream >> number_count;
|
|
|
|
|
|
|
|
|
|
Input in;
|
|
|
|
|
in.numbers.resize(number_count);
|
|
|
|
|
if (prompt) {
|
|
|
|
|
cerr << "Enter " << number_count << " numbers: ";
|
|
|
|
|
}
|
|
|
|
|
cerr << "Enter " << number_count << " numbers: ";
|
|
|
|
|
for (size_t i = 0; i < number_count; i++) {
|
|
|
|
|
in_stream >> in.numbers[i];
|
|
|
|
|
cin >> in.numbers[i];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (prompt) {
|
|
|
|
|
cerr << "Enter bin count: ";
|
|
|
|
|
}
|
|
|
|
|
in_stream >> in.bin_count;
|
|
|
|
|
cerr << "Enter bin count: ";
|
|
|
|
|
cin >> in.bin_count;
|
|
|
|
|
|
|
|
|
|
return in;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int main(int argc, char* argv[]) {
|
|
|
|
|
curl_global_init(CURL_GLOBAL_ALL);
|
|
|
|
|
bool prompt = true;
|
|
|
|
|
auto in = input_data(cin, prompt);
|
|
|
|
|
int main() {
|
|
|
|
|
auto in = input_data();
|
|
|
|
|
auto bins = make_histogram(in.numbers, in.bin_count);
|
|
|
|
|
show_histogram_svg(bins);
|
|
|
|
|
show_histogram_text(bins);
|
|
|
|
|