code: разделение программы на функции

Этот коммит содержится в:
2023-04-23 21:13:31 +03:00
родитель acb9bcd7f4
Коммит 20bb417d84
7 изменённых файлов: 130 добавлений и 75 удалений

22
text.cpp Обычный файл
Просмотреть файл

@@ -0,0 +1,22 @@
#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";
}
}