code: изменение функции input_data()

master
victoriaCS 4 недель назад
Родитель da84686c71
Сommit b7e2e9af42

@ -1,17 +1,18 @@
#include <iostream>
#include <vector>
#include "histogram.h"
#include "text.h"
#include "svg.h"
#include "hictogram.h"
//#include "doctest.h"
using namespace std;
struct Input {
vector<double> numbers;
size_t bin_count{};
size_t block_width{};
};
Input input_data() {
size_t number_count;
Input input_data(istream& in_steam = cin) {
cerr << "Enter number count: ";
cin >> number_count;
@ -21,16 +22,17 @@ Input input_data() {
for (size_t i = 0; i < number_count; i++) {
cin >> in.numbers[i];
}
cerr << "Enter bin count: ";
cin >> in.bin_count;
return in;
}
int main() {
auto in = input_data();
auto bins = make_histogram(in.numbers, in.bin_count);
show_histogram_svg(bins);
show_histogram_svg(bins, in.block_width);
}

Загрузка…
Отмена
Сохранить