2024-04-30 08:22:05 -04:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#define MAX_AMOUNT_OF_LENGTHS 256
|
|
|
|
|
2024-05-02 09:52:00 -04:00
|
|
|
// drawing chart of chars usage
|
|
|
|
|
2024-04-30 08:22:05 -04:00
|
|
|
main()
|
|
|
|
{
|
|
|
|
int c, i, j;
|
|
|
|
int nlengths[MAX_AMOUNT_OF_LENGTHS];
|
|
|
|
|
|
|
|
for (i = 0; i < MAX_AMOUNT_OF_LENGTHS; ++i)
|
|
|
|
nlengths[i] = 0;
|
|
|
|
|
|
|
|
while ((c = getchar()) != '\n')
|
|
|
|
++nlengths[c];
|
|
|
|
|
|
|
|
for (i = 1; i < MAX_AMOUNT_OF_LENGTHS; ++i)
|
|
|
|
{
|
|
|
|
int counter = nlengths[i];
|
|
|
|
if (counter > 0)
|
|
|
|
{
|
|
|
|
printf("%c: ", i);
|
|
|
|
while (counter > 0)
|
|
|
|
{
|
|
|
|
--counter;
|
|
|
|
printf("*");
|
|
|
|
}
|
|
|
|
printf("\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|