diff --git a/histogram.cpp b/histogram.cpp index a166b3c..51b6553 100644 --- a/histogram.cpp +++ b/histogram.cpp @@ -2,7 +2,7 @@ #include "histogram_internal.h" using namespace std; -/* + vector make_histogram(const vector& numbers, size_t bin_count) { vector bins(bin_count); @@ -43,7 +43,7 @@ vector make_histogram(const vector& numbers, size_t bin_count) { } } return bins; -} */ +} bool find_minmax(const vector& numbers, double& min, double& max) { if (numbers.size() == 0) { diff --git a/histogram.h b/histogram.h index 63346a6..928d4e4 100644 --- a/histogram.h +++ b/histogram.h @@ -2,6 +2,5 @@ #include -std::vector -make_histogram(const std::vector& numbers, size_t bin_count); +std::vector make_histogram(const std::vector& numbers, size_t bin_count); void find_minmax(const std::vector& numbers, double& min, double& max); \ No newline at end of file diff --git a/lab1.cpp b/lab1.cpp index cb54131..fc7e837 100644 --- a/lab1.cpp +++ b/lab1.cpp @@ -1,11 +1,11 @@ -// lab1.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы. -// + #include #include #include #include "histogram.h" #include "text.h" +#include "svg.h" using namespace std; @@ -40,7 +40,7 @@ int main() { Input in = input_data(); auto bins = make_histogram(in.numbers, in.bin_count); - show_histogram_text(bins, in.bin_count); - + //show_histogram_text(bins, in.bin_count); + show_histogram_svg(bins); } \ No newline at end of file diff --git a/lab1.sln b/lab1.sln index cc79963..379a52d 100644 --- a/lab1.sln +++ b/lab1.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.3.32922.545 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lab1", "lab1\lab1.vcxproj", "{E29B0ECE-B766-48CE-A826-ACFB8EFF2990}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lab1", "lab1.vcxproj", "{E29B0ECE-B766-48CE-A826-ACFB8EFF2990}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -26,6 +26,6 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {2E4B7C6A-7457-47BC-985A-B37A534B97DD} + SolutionGuid = {5DF3BD0D-8660-486C-B0A4-A7F22876A15B} EndGlobalSection EndGlobal diff --git a/lab1.vcxproj b/lab1.vcxproj index ce5422b..b0e1a63 100644 --- a/lab1.vcxproj +++ b/lab1.vcxproj @@ -129,11 +129,12 @@ + - + diff --git a/lab1.vcxproj.filters b/lab1.vcxproj.filters index 7e1d14f..d566c7c 100644 --- a/lab1.vcxproj.filters +++ b/lab1.vcxproj.filters @@ -24,6 +24,9 @@ Исходные файлы + + Исходные файлы + @@ -32,7 +35,7 @@ Исходные файлы - + Исходные файлы diff --git a/marks.svg b/marks.svg new file mode 100644 index 0000000..e69de29 diff --git a/marks.txt b/marks.txt new file mode 100644 index 0000000..2cdb9aa --- /dev/null +++ b/marks.txt @@ -0,0 +1,3 @@ +10 +3 3 4 4 4 4 4 5 5 5 +3 diff --git a/svg.cpp b/svg.cpp new file mode 100644 index 0000000..ebef607 --- /dev/null +++ b/svg.cpp @@ -0,0 +1,25 @@ +#include +#include "svg.h" + +using namespace std; + +void +svg_begin(double width, double height) { + cout << "\n"; + cout << "\n"; +} + +void +svg_end() { + cout << "\n"; +} + + +void show_histogram_svg(const vector& bins) { + svg_begin(400, 300); + svg_end(); +} diff --git a/svg.h b/svg.h new file mode 100644 index 0000000..538bd01 --- /dev/null +++ b/svg.h @@ -0,0 +1,7 @@ +#pragma once + +#include + +void svg_begin(double width, double height); +void svg_end(); +void show_histogram_svg(const std::vector& bins); \ No newline at end of file