home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 January
/
usenetsourcesnewsgroupsinfomagicjanuary1994.iso
/
sources
/
unix
/
volume17
/
contest-prog
/
part01
/
prob2.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1989-02-06
|
308 b
|
18 lines
main()
{
char line[99];
int count[256];
int i;
char *gets();
for(i=0;i<256;i++)count[i]=0;
while( gets(line)==line )
for(i=0;line[i] && line[i]!='\n';i++)
count[ line[i] ]++;
printf("%5d%5d\n",'\t',count['\t']);
for(i=' ';i<0177;i++) if(count[i])printf("%5d%5d\n",i,count[i]);
exit(0);
}