All pastes #822908 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-12-19 01:14 UTC
rendered paste body
#include <stdio.h>
main(){
int grab, ait, nwhite, nother;
int aray[10];
nwhite=nother=0;
for(ait=0;ait<10;++ait)
	aray[ait]=0;
printf("type digits\n");
while((grab=getchar())!=EOF)
	if(grab>='0'&&grab<='9')
		++aray[grab-'0'];
	else if(grab==' '||grab=='\n'||grab=='\t')
		++nwhite;
	else
		++nother;
printf("\ndigits << ");
for(ait=0;ait<10;++ait)
	printf("%d ", aray[ait]);
printf("\nwhitespaces << %d\nother characters << %d\n", nwhite, nother);
}