// Podatkovna zbirka: hist.cpp
// Izris histograma
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
const int velikost_polja = 10;
int n[velikost_polja ] = {19, 3, 15, 7, 11, 9, 13, 5, 17, 1};
cout << " Element" << setw(14) << "Vrednost"
<< setw(17) << "Histogram" << endl;
for (int i = 0; i < velikost_polja ; i++) {
cout << setw(7) << i << setw(13) << n[i] << " ";
for(int j = 1; j <= n[i]; j++) // izris ene palice histograma
cout << '*';
cout << endl;
}
system("pause");
return 0;
}