lab34 (VasinaEY) 3 недель назад
Родитель d0c5bba80e
Сommit 2e7e252bff

@ -1,6 +1,6 @@
#include "histogram.h"
void find_minmax(std::vector<double> vec, double& min, double& max) {
void find_minmax(vector<double> vec, double& min, double& max) {
min = vec[0];

@ -1,6 +1,6 @@
#ifndef HISTOGRAM_INTERNAL_H_INCLUDED
#define HISTOGRAM_INTERNAL_H_INCLUDED
void find_minmax(std::vector<double> vec, double& min, double& max);
using namespace std;
void find_minmax(vector<double> vec, double& min, double& max);
#endif // HISTOGRAM_INTERNAL_H_INCLUDED

@ -32,7 +32,13 @@
<Add option="-Wall" />
<Add option="-fexceptions" />
</Compiler>
<Unit filename="histogram.cpp" />
<Unit filename="histogram.h" />
<Unit filename="main.cpp" />
<Unit filename="svg.cpp" />
<Unit filename="svg.h" />
<Unit filename="text.cpp" />
<Unit filename="text.h" />
<Extensions>
<lib_finder disable_auto="1" />
</Extensions>

@ -2,9 +2,9 @@
#include <vector>
#include "histogram.h"
#include "text.h"
#include "svg.h"
struct Input {
std::vector<double> numbers;
vector<double> numbers;
size_t bin_count{};
};
@ -12,18 +12,18 @@ Input input_data() {
Input in;
size_t number_count;
std::cerr << "Enter the number of elements: ";
std::cin >> number_count;
cerr << "Enter the number of elements: ";
cin >> number_count;
in.numbers.resize(number_count);
std::cerr << "\nEnter " << number_count << " elements:" << std::endl;
cerr << "\nEnter " << number_count << " elements:" << endl;
for (size_t i = 0; i < number_count; i++) {
std::cin >> in.numbers[i];
cin >> in.numbers[i];
}
std::cerr << "Enter the number of bins: ";
std::cin >> in.bin_count;
cerr << "Enter the number of bins: ";
cin >> in.bin_count;
return in;
}
@ -31,6 +31,6 @@ Input input_data() {
int main() {
auto in = input_data();
auto bins = make_histogram(in.bin_count, in.numbers);
show_histogram(bins);
show_histogram_svg(bins);
return 0;
}

@ -1,7 +1,7 @@
#include "text.h"
#include <iostream>
void show_histogram(const vector<size_t>& bins) {
void show_histogram(const std::vector<size_t>& bins) {
bool gigant = false;

@ -2,7 +2,7 @@
#define TEXT_H_INCLUDED
#include <vector>
void show_histogram(const vector<size_t>& bins);
using namespace std;
void show_histogram(const std::vector<size_t>& bins);
#endif // TEXT_H_INCLUDED

Двоичные данные
unittest/bin/Debug/unittest.exe

Двоичный файл не отображается.

Двоичные данные
unittest/obj/Debug/histogram.o

Двоичный файл не отображается.

Двоичные данные
unittest/obj/Debug/unittest.o

Двоичный файл не отображается.

@ -31,6 +31,19 @@
<Compiler>
<Add option="-Wall" />
</Compiler>
<Unit filename="../doctest.h">
<Option target="&lt;{~None~}&gt;" />
</Unit>
<Unit filename="../histogram.cpp" />
<Unit filename="../histogram.h" />
<Unit filename="../marks.h">
<Option target="&lt;{~None~}&gt;" />
</Unit>
<Unit filename="../svg.cpp" />
<Unit filename="../svg.h">
<Option target="&lt;{~None~}&gt;" />
</Unit>
<Unit filename="../unittest.cpp" />
<Extensions>
<lib_finder disable_auto="1" />
</Extensions>

@ -1,12 +1,12 @@
# depslib dependency file v1.0
1748213255 source:c:\users\home\desktop\lab34\laba01\histogram.cpp
1748243702 source:c:\users\home\desktop\lab34\laba01\histogram.cpp
"histogram.h"
1748213210 c:\users\home\desktop\lab34\laba01\histogram.h
1748243652 c:\users\home\desktop\lab34\laba01\histogram.h
<vector>
<iostream>
1748213127 source:c:\users\home\desktop\lab34\laba01\unittest.cpp
1748213519 source:c:\users\home\desktop\lab34\laba01\unittest.cpp
"doctest.h"
"histogram_internal.h"
@ -55,5 +55,81 @@
<sys/time.h>
<unistd.h>
1748213259 c:\users\home\desktop\lab34\laba01\histogram_internal.h
1748243717 c:\users\home\desktop\lab34\laba01\histogram_internal.h
1748242437 source:c:\users\home\desktop\lab34\laba01\svg.cpp
"svg.h"
1748242437 c:\users\home\desktop\lab34\laba01\svg.h
<iostream>
<vector>
<string>
<math.h>
1748243704 source:c:\users\u111-15\desktop\lab34\laba01\histogram.cpp
"histogram.h"
1748243654 c:\users\u111-15\desktop\lab34\laba01\histogram.h
<vector>
<iostream>
1748386434 source:c:\users\u111-15\desktop\lab34\laba01\svg.cpp
"svg.h"
1748242438 c:\users\u111-15\desktop\lab34\laba01\svg.h
<iostream>
<vector>
<string>
<math.h>
1748213520 source:c:\users\u111-15\desktop\lab34\laba01\unittest.cpp
"doctest.h"
"histogram_internal.h"
1748430259 c:\users\u111-15\desktop\lab34\laba01\doctest.h
<signal.h>
<ciso646>
<cstddef>
<ostream>
<istream>
<type_traits>
"doctest_fwd.h"
<ctime>
<cmath>
<climits>
<math.h>
<new>
<cstdio>
<cstdlib>
<cstring>
<limits>
<utility>
<fstream>
<sstream>
<iostream>
<algorithm>
<iomanip>
<vector>
<atomic>
<mutex>
<set>
<map>
<unordered_set>
<exception>
<stdexcept>
<csignal>
<cfloat>
<cctype>
<cstdint>
<string>
<sys/types.h>
<unistd.h>
<sys/sysctl.h>
<AfxWin.h>
<windows.h>
<io.h>
<sys/time.h>
<unistd.h>
1748243718 c:\users\u111-15\desktop\lab34\laba01\histogram_internal.h

Загрузка…
Отмена
Сохранить