Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

33 строки
760 B
C++

#include <iostream>
#include <vector>
#include <math.h>
#include "text.h"
using namespace std;
const size_t SCREEN_WIDTH = 80;
const size_t MAX_ASTERISK = SCREEN_WIDTH - 3 - 1;
void show_histogram_text(const std::vector<size_t> bins, size_t bin_count, const std::vector<double> numbers,size_t max_count)
{
size_t procent=100;
for(size_t i = 0;i<(bin_count-1);i++){
double number = numbers.size();
printf("%3d:", bins[i]);
for(size_t j = 0;j<bins[i];j++)
{
cout<<"*";
}
for(size_t g=0;g<(max_count-bins[i]);g++)
{
cout<<" ";
}
cout<<endl;
}
//procent=Math.round(procent);
printf("%3d:",bins[bin_count-1]);
for(size_t j = 0;j<bins[bin_count - 1];j++)
{
cout<<"*";
}
}