Родитель
1bd68a4d87
Сommit
b0f8939ed6
@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="lab03" />
|
||||
<Option pch_mode="2" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="Debug">
|
||||
<Option output="bin/Debug/lab03" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="obj/Debug/" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-g" />
|
||||
</Compiler>
|
||||
</Target>
|
||||
<Target title="Release">
|
||||
<Option output="bin/Release/lab03" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="obj/Release/" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-O2" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="-s" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<Compiler>
|
||||
<Add option="-Wall" />
|
||||
<Add option="-fexceptions" />
|
||||
</Compiler>
|
||||
<Unit filename="histogram.cpp" />
|
||||
<Unit filename="histogram.h">
|
||||
<Option target="<{~None~}>" />
|
||||
</Unit>
|
||||
<Unit filename="main.cpp" />
|
||||
<Unit filename="svg.cpp" />
|
||||
<Unit filename="svg.h" />
|
||||
<Unit filename="text.cpp" />
|
||||
<Unit filename="text.h">
|
||||
<Option target="<{~None~}>" />
|
||||
</Unit>
|
||||
<Extensions>
|
||||
<lib_finder disable_auto="1" />
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
@ -0,0 +1,37 @@
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include "histogram.h"
|
||||
#include "text.h"
|
||||
#include "svg.h"
|
||||
using namespace std;
|
||||
struct Input {
|
||||
vector<double> numbers;
|
||||
size_t bin_count{};
|
||||
size_t number_count{};
|
||||
size_t max_count{};
|
||||
};
|
||||
Input
|
||||
input_data() {
|
||||
Input in;
|
||||
cerr << "Enter number count: ";
|
||||
cin >> in.number_count;
|
||||
vector<double> numbers(in.number_count);
|
||||
in.numbers.resize(in.number_count);
|
||||
for (size_t i = 0; i < in.number_count; i++) {
|
||||
cin >> in.numbers[i];
|
||||
}
|
||||
size_t bin_count;
|
||||
cerr << "Enter bin count: ";
|
||||
cin >> in.bin_count;
|
||||
|
||||
size_t max_count;
|
||||
in.max_count = 0;
|
||||
return in;
|
||||
}
|
||||
int main()
|
||||
{
|
||||
auto in = input_data();
|
||||
auto bins = make_histogram(in.numbers, in.bin_count, in.number_count, in.max_count);
|
||||
show_histogram_svg(bins, in.max_count, in.bin_count);
|
||||
return 0;
|
||||
}
|
Загрузка…
Ссылка в новой задаче