#include #include using namespace std; int main(){ const size_t SCREEN_WIDTH = 80; const size_t MAX_ASTERISK = SCREEN_WIDTH - 3 - 1; size_t number_count; cerr<<"enter number count"<>number_count; vector numbers(number_count); cerr<<"put elements with enter"<>(numbers[i]); } size_t bin_count; cerr<<"enter bin count"<>bin_count; vector bins(bin_count);//счетчики в корзинах . нач значения нули double min = numbers[0];//макс и мин числа в потоке double max = numbers[0]; for(double x: numbers){ if(xmax) { max = x; } } double bin_size = (max - min)/bin_count; for(size_t i = 0; imax_b){ max_b = x; } } //защита double sum=0; double sr; for(int i=0; isr){ for (int j = 0; j < sr; j++){ cout << "*"; } for (int m = 0; m < bins[i]-sr; m++){ cout << "+"; } } cout << endl; } } else{ for (int i = 0; i < bin_count; i++){ size_t height = MAX_ASTERISK * (static_cast(bins[i]) / max_b); if (bins[i] < 10){ cout << " "; } else if (bins[i] < 100) { cout << " "; } cout<sr){//защита for (int j = 0; j < sr; j++){ cout << "*"; } for (int m = 0; m < height-sr; m++){ cout << "+"; } } cout << endl; } } }