Маленькие поправки
Этот коммит содержится в:
@@ -3,8 +3,14 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
void find_minmax(const vector<double>& numbers, double& min, double& max) {
|
void find_minmax(const vector<double>& numbers, double& min, double& max) {
|
||||||
|
if (numbers.empty())
|
||||||
|
{
|
||||||
|
min = 0;
|
||||||
|
max = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
max = numbers[0];
|
max = numbers[0];
|
||||||
min = numbers[1];
|
min = numbers[0];
|
||||||
for (double x : numbers) {
|
for (double x : numbers) {
|
||||||
if (x < min) min = x;
|
if (x < min) min = x;
|
||||||
else if (x > max) max = x;
|
else if (x > max) max = x;
|
||||||
|
|||||||
@@ -32,7 +32,10 @@
|
|||||||
<Add option="-Wall" />
|
<Add option="-Wall" />
|
||||||
<Add option="-fexceptions" />
|
<Add option="-fexceptions" />
|
||||||
</Compiler>
|
</Compiler>
|
||||||
|
<Unit filename=".gitignore" />
|
||||||
|
<Unit filename="histogram.cpp" />
|
||||||
<Unit filename="main.cpp" />
|
<Unit filename="main.cpp" />
|
||||||
|
<Unit filename="text.cpp" />
|
||||||
<Extensions>
|
<Extensions>
|
||||||
<lib_finder disable_auto="1" />
|
<lib_finder disable_auto="1" />
|
||||||
</Extensions>
|
</Extensions>
|
||||||
|
|||||||
4
main.cpp
4
main.cpp
@@ -2,6 +2,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include "histogram.h"
|
#include "histogram.h"
|
||||||
#include "text.h"
|
#include "text.h"
|
||||||
|
#include "svg.h"
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
struct Input {
|
struct Input {
|
||||||
@@ -29,5 +30,6 @@ Input input_data() {
|
|||||||
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, in.bin_count);
|
show_histogram_svg(bins);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user