|
|
@ -41,20 +41,52 @@ int main()
|
|
|
|
bins[bin_count-1]++;
|
|
|
|
bins[bin_count-1]++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (size_t i = 0; i < number_count; i++)
|
|
|
|
size_t Maxbins = 0;
|
|
|
|
|
|
|
|
for (size_t i = 0; i < bin_count; i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for (size_t j = 0; j < bin_count; j++)
|
|
|
|
if (bins[i] > Maxbins)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (bins[j]> i)
|
|
|
|
Maxbins = bins[i];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const size_t MAX_HEIGHT = 76;
|
|
|
|
|
|
|
|
if (Maxbins <= MAX_HEIGHT)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
for (size_t i = 0; i < bin_count; i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (bins[i] < 10)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
cout << " ";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
cout << " " << bins[i]<< "|";
|
|
|
|
|
|
|
|
for (size_t j = 0; j < bins[i]; j++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
cout << "*";
|
|
|
|
cout << "*";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
cout << endl;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
for (size_t i = 0; i < bin_count; i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
size_t height = static_cast<size_t>(MAX_HEIGHT * (static_cast<double>(bins[i]) / Maxbins));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (bins[i] < 100)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
cout << " ";
|
|
|
|
cout << " ";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (bins[i] < 10)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
cout << " ";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
cout << bins[i] << "|";
|
|
|
|
|
|
|
|
for (size_t j = 0; j < height; j++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
cout << "*";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
cout << endl;
|
|
|
|
cout << endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|