Родитель
68b2820303
Сommit
7470cdab43
@ -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";
|
||||
}
|
||||
}
|
@ -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
|
Загрузка…
Ссылка в новой задаче