code: 3. разделение программы на файлы

main
TarasovEE 3 месяцев назад
Родитель eeb73c32dc
Сommit 0bb7987e43

@ -1,5 +1,7 @@
#include <iostream> #include <iostream>
#include <vector> #include <vector>
#include "histogram.h"
#include "text.h"
using namespace std; using namespace std;
// Ñòðóêòóðà // Ñòðóêòóðà
@ -16,7 +18,7 @@ Input
input_data() input_data()
{ {
Input in; Input in;
size_t number_count, bin_count; size_t number_count;
cerr << "Enter number count: "; cerr << "Enter number count: ";
cin >> number_count; cin >> number_count;
@ -28,25 +30,10 @@ input_data()
return in; return in;
} }
// Ïîèñê ìàêñèìóìà è ìèíèìóìà ñðåäè îöåíîê.
void find_minmax(const vector<double>& numbers, double& min, double& max)
{
min = numbers[0];
max = numbers[0];
for (double x : numbers)
{
if (x < min)
min = x;
else if (x > max)
max = x;
}
}
int main() int 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_text(bins, in.bin_count);
return 0;
} }

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