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