Родитель
10ca1b3023
Сommit
e6ce0250e4
@ -1,38 +1,38 @@
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include "histogram.h"
|
||||
#include "text.h"
|
||||
#include "svg.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
struct Input {
|
||||
struct Input
|
||||
{
|
||||
vector<double> numbers;
|
||||
size_t bin_count{};
|
||||
};
|
||||
|
||||
Input
|
||||
input_data() {
|
||||
Input input_data()
|
||||
{
|
||||
size_t number_count;
|
||||
cout << "Enter number count: ";
|
||||
cin >> number_count;
|
||||
Input in;
|
||||
in.numbers.resize(number_count);
|
||||
vector<double> numbers(number_count);
|
||||
for (size_t i = 0; i < number_count; i++)
|
||||
{
|
||||
cin >> in.numbers[i];
|
||||
}
|
||||
{cin >> in.numbers[i];}
|
||||
size_t bin_count;
|
||||
cout << "Enter count bin : ";
|
||||
cin >> in.bin_count;
|
||||
return in;
|
||||
}
|
||||
|
||||
|
||||
int main(){
|
||||
int main()
|
||||
{
|
||||
const size_t SCREEN_WIDTH = 80;
|
||||
const size_t MAX_ASTERISK = SCREEN_WIDTH - 3 - 1;
|
||||
auto in = input_data();
|
||||
auto bins = make_histogram(in.numbers, in.bin_count);
|
||||
show_histogram_text(bins);
|
||||
const std::vector<double> bins = make_histogram(in.numbers, in.bin_count);
|
||||
show_histogram_svg(bins);
|
||||
return 0;
|
||||
}
|
||||
|
Загрузка…
Ссылка в новой задаче