45 строки
747 B
C++
45 строки
747 B
C++
#include <math.h>
|
|
#include <iostream>
|
|
#include <conio.h>
|
|
#include <vector>
|
|
#include "histogram.h"
|
|
#include "text.h"
|
|
#include "svg.h"
|
|
|
|
using namespace std;
|
|
|
|
|
|
vector<double>
|
|
input_numbers(size_t count) {
|
|
vector<double> result(count);
|
|
cerr << "Enter numbers: ";
|
|
for (size_t i = 0; i < count; i++) {
|
|
cin >> result[i];
|
|
}
|
|
return result;
|
|
}
|
|
|
|
|
|
int main()
|
|
{
|
|
|
|
//ввод данных
|
|
size_t number_count;
|
|
cerr << "Enter number count: ";
|
|
cin >> number_count;
|
|
|
|
const auto numbers = input_numbers(number_count);
|
|
|
|
size_t bin_count;
|
|
cerr << "Enter bin count: ";
|
|
cin >> bin_count;
|
|
|
|
const auto bins = make_histogram(numbers, bin_count);
|
|
|
|
//show_histogram_text(bins,bin_count);//
|
|
show_histogram_svg(bins, number_count, bin_count);
|
|
|
|
return 0;
|
|
}
|
|
|