code: разделение программы на файлы
Этот коммит содержится в:
15
main.cpp
15
main.cpp
@@ -1,19 +1,16 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include "svg.h"
|
||||||
|
#include "hictogram.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
const size_t SCREEN_WIDTH = 80;
|
|
||||||
const size_t MAX_ASTERISK = SCREEN_WIDTH - 3 - 1;
|
|
||||||
|
|
||||||
|
|
||||||
struct Input {
|
struct Input {
|
||||||
vector<double> numbers;
|
vector<double> numbers;
|
||||||
size_t bin_count{};
|
size_t bin_count{};
|
||||||
};
|
};
|
||||||
|
|
||||||
Input
|
Input input_data() {
|
||||||
input_data() {
|
|
||||||
size_t number_count;
|
size_t number_count;
|
||||||
cerr << "Enter number count: ";
|
cerr << "Enter number count: ";
|
||||||
cin >> number_count;
|
cin >> number_count;
|
||||||
@@ -31,11 +28,9 @@ input_data() {
|
|||||||
return in;
|
return in;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int main() {
|
||||||
main() {
|
|
||||||
auto in = input_data();
|
auto in = input_data();
|
||||||
auto bins = make_histogram(in.numbers, in.bin_count);
|
auto bins = make_histogram(in.numbers, in.bin_count);
|
||||||
show_histogram_text(bins);
|
show_histogram_svg(bins);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user