создание text
Этот коммит содержится в:
15
lab1.depend
15
lab1.depend
@@ -12,3 +12,18 @@
|
||||
1682271932 c:\users\admin\onedrive\Ðàáî÷èé ñòîë\lab1\histogam.h
|
||||
<vector>
|
||||
|
||||
1682272812 source:c:\users\admin\onedrive\Ðàáî÷èé ñòîë\lab1\histogam.cpp
|
||||
<iostream>
|
||||
<vector>
|
||||
<cmath>
|
||||
"histogam.h"
|
||||
|
||||
1682273357 source:c:\users\admin\onedrive\Ðàáî÷èé ñòîë\lab1\text.cpp
|
||||
<iostream>
|
||||
<vector>
|
||||
<cmath>
|
||||
"text.h"
|
||||
|
||||
1682273447 c:\users\admin\onedrive\Ðàáî÷èé ñòîë\lab1\text.h
|
||||
<vector>
|
||||
|
||||
|
||||
21
main.cpp
21
main.cpp
@@ -2,6 +2,7 @@
|
||||
#include <vector>
|
||||
#include <cmath>
|
||||
#include "histogam.h"
|
||||
#include "text.h"
|
||||
using namespace std;
|
||||
|
||||
|
||||
@@ -27,26 +28,6 @@ input_data() {
|
||||
return in;
|
||||
}
|
||||
|
||||
|
||||
void show_histogram_text(vector <size_t> bins, size_t bin_count ) {
|
||||
|
||||
for (size_t i = 0; i < bin_count; i++) {
|
||||
if (bins[i] < 100) {
|
||||
cout << " ";
|
||||
}
|
||||
if (bins[i] < 10) {
|
||||
cout << " ";
|
||||
}
|
||||
cout << bins[i] << "|";
|
||||
for (size_t j = 0; j < bins[i]; j++) {
|
||||
cout << "*";
|
||||
}
|
||||
cout << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
Input in = input_data();
|
||||
|
||||
21
text.cpp
Обычный файл
21
text.cpp
Обычный файл
@@ -0,0 +1,21 @@
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <cmath>
|
||||
#include "text.h"
|
||||
using namespace std;
|
||||
void show_histogram_text(vector <size_t> bins, size_t bin_count ) {
|
||||
|
||||
for (size_t i = 0; i < bin_count; i++) {
|
||||
if (bins[i] < 100) {
|
||||
cout << " ";
|
||||
}
|
||||
if (bins[i] < 10) {
|
||||
cout << " ";
|
||||
}
|
||||
cout << bins[i] << "|";
|
||||
for (size_t j = 0; j < bins[i]; j++) {
|
||||
cout << "*";
|
||||
}
|
||||
cout << "\n";
|
||||
}
|
||||
}
|
||||
8
text.h
Обычный файл
8
text.h
Обычный файл
@@ -0,0 +1,8 @@
|
||||
#ifndef TEXT_H_INCLUDED
|
||||
#define TEXT_H_INCLUDED
|
||||
#include <vector>
|
||||
|
||||
void show_histogram_text(std::vector <size_t> bins, size_t bin_count );
|
||||
|
||||
|
||||
#endif // TEXT_H_INCLUDED
|
||||
Ссылка в новой задаче
Block a user