/************************************************/
/* soubor CETNO_CH.C */
/* pocita histogram vyskytu ASCII znaku s kody */
/* 32 az 255 */
/************************************************/
#define PAGE 24
#include <stdio.h>
#include <conio.h>
void main(void)
{
int ch, cetnost[255 - ' '], vytisknuto;
for (ch = ' ' - ' '; ch < 255 - ' '; ch++)
{
cetnost[ch] = 0;
}
while ((ch = getchar()) != EOF)
{
cetnost[ch - ' ']++;
} /* while ((ch = getchar()) != EOF) */
vytisknuto = 0;
for (ch = ' ' - ' '; ch < 255 - ' '; ch++)
{
if (cetnost[ch] != 0)
{
printf("%c %4d\n", ch + ' ', cetnost[ch]);
vytisknuto++;
}
if (((vytisknuto % PAGE) == 0) && (vytisknuto != 0))
{
printf("pro pokracovani stiskni klavesu");
getch();
printf("\n");
}
}
} /* main */