diff --git a/Lab1.cbp b/Lab1.cbp
new file mode 100644
index 0000000..031adb2
--- /dev/null
+++ b/Lab1.cbp
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/histogram.cpp b/histogram.cpp
new file mode 100644
index 0000000..b8dd626
--- /dev/null
+++ b/histogram.cpp
@@ -0,0 +1,45 @@
+#include "histogram.h"
+
+std::vector make_histogram(std::vector numbers, size_t bin_count)
+{
+ double max;
+ double min;
+ std::vector bins;
+ bins.resize(bin_count);
+ find_minmax(numbers, min, max);
+ double bin_size = (max - min) / bin_count;
+ for (size_t i = 0; i < numbers.size(); i++) {
+ bool found = false;
+ for (size_t j = 0; (j < bin_count - 1) && !found; j++) {
+ auto lo = min + j * bin_size;
+ auto hi = min + (j + 1) * bin_size;
+ if ((lo <= numbers[i]) && (hi > numbers[i])) {
+ bins[j]++;
+ found = true;
+ }
+ }
+ if (!found) {
+ bins[bin_count - 1]++;
+ }
+ }
+ return bins;
+}
+
+
+bool find_minmax(std::vector numbers, double& min, double& max) {
+ if(numbers.size()==0){
+ return false;
+ }
+ min = numbers[0];
+ max = numbers[0];
+
+ for (double number : numbers) {
+ if (min > number) {
+ min = number;
+ }
+ if (max < number) {
+ max = number;
+ }
+ }
+ return true;
+}
diff --git a/histogram.h b/histogram.h
new file mode 100644
index 0000000..f182421
--- /dev/null
+++ b/histogram.h
@@ -0,0 +1,10 @@
+#ifndef HISTOGRAM_H_INCLUDED
+#define HISTOGRAM_H_INCLUDED
+
+#include
+
+
+bool find_minmax(std::vector numbers, double& min, double& max);
+std::vector make_histogram(std::vector numbers, size_t bin_count);
+
+#endif // HISTOGRAM_H_INCLUDED