Сравнить коммиты
1 Коммитов
a1a63a7b14
...
main
| Автор | SHA1 | Дата | |
|---|---|---|---|
| b1812bf7a8 |
3
.gitignore
поставляемый
3
.gitignore
поставляемый
@@ -1,7 +1,4 @@
|
||||
/bin
|
||||
/obj
|
||||
111.c
|
||||
lab01.cpp
|
||||
lab_01.layout
|
||||
git.ignore.c
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "histogram.h"
|
||||
using namespace std;
|
||||
void
|
||||
find_minmax(vector<double> numbers, double& min, double& max) {
|
||||
find_minmax(const vector<double>& numbers, double& min, double& max) {
|
||||
min = numbers[0];
|
||||
max = numbers[0];
|
||||
for (double x : numbers) {
|
||||
@@ -20,7 +20,7 @@ vector<size_t> make_histogram(vector<double> numbers, size_t bin_count) {
|
||||
vector <size_t> bins(bin_count);
|
||||
double min, max;
|
||||
find_minmax(numbers, min, max);
|
||||
size_t countt;
|
||||
size_t count;
|
||||
double bin_size = (max - min) / bin_count;
|
||||
for (size_t i = 0; i < numbers.size(); i++) {
|
||||
bool found = false;
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
<Unit filename="histogram.h" />
|
||||
<Unit filename="histogram_internal.h" />
|
||||
<Unit filename="main.cpp" />
|
||||
<Unit filename="marks.txt" />
|
||||
<Unit filename="svg.cpp" />
|
||||
<Unit filename="svg.h" />
|
||||
<Unit filename="text.cpp" />
|
||||
|
||||
2
main.cpp
2
main.cpp
@@ -16,7 +16,7 @@ input_data(){
|
||||
cin >> number_count;
|
||||
Input in;
|
||||
in.numbers.resize(number_count);
|
||||
for(int i;i<number_count;i++)
|
||||
for(size_t i=0;i<number_count;i++)
|
||||
{
|
||||
cin >> in.numbers[i];
|
||||
}
|
||||
|
||||
@@ -3,11 +3,12 @@
|
||||
#include "doctest.h"
|
||||
#include "histogram_internal.h"
|
||||
|
||||
|
||||
TEST_CASE("distinct positive numbers") {
|
||||
double min = 0;
|
||||
double max = 0;
|
||||
find_minmax({1, 2}, min, max);
|
||||
std::vector<double>v{2,1};
|
||||
find_minmax(v, min, max);
|
||||
CHECK(min == 1);
|
||||
CHECK(max == 2);
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user