code: добавил гистограмму

main
Senya (YershovArA) 2 лет назад
Родитель 6120a2a2c2
Сommit 279ed6d725

@ -32,10 +32,18 @@
<Add option="-Wall" />
<Add option="-fexceptions" />
</Compiler>
<Unit filename=",r,t,t,,t r.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename=".gitignore" />
<Unit filename="111.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="histogram.cpp" />
<Unit filename="histogram.h" />
<Unit filename="main.cpp" />
<Unit filename="text.cpp" />
<Unit filename="text.h" />
<Extensions>
<lib_finder disable_auto="1" />
</Extensions>

@ -1,5 +1,7 @@
#include <iostream>
#include <vector>
#include <math.h>
#include "histogram.h"
using namespace std;
@ -7,7 +9,7 @@ using namespace std;
struct Input {
vector <double> numbers;
size_t bin_count{};
size_t bin_count{}, number_count{};
};
Input input_data(){
@ -25,30 +27,14 @@ Input input_data() {
int main()
{
Input in = input_data();
double min, max;
find_minmax(in.numbers, min, max);
}
auto in = input_data();
auto bins = make_histogram(in.numbers, in.bin_count);
}
void find_minmax(vector<double>& numbers, double& min, double& max) {
auto counts=numbers.size();
int i;
min = number[0];
max = number[0];
for (i=0; i<counts;i++) {
if (number[i]< minn) {
min = number[i];
}
else if (number[i]> maxx) {
max = number[i];
}
}
}

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