/*--------------------------------------------*/ /*Minor adaption of Framework example */ /*Travis Fisher */ /*fisher don't spam me at math dot psu dot edu*/ /*--------------------------------------------*/ #include #include int main () { int Input; unsigned long total=0; unsigned long Tally[256]={0}; while ((Input=getchar())!=EOF) { unsigned char Vote=Input; if (!isspace(Vote)){ Tally[Input]+=1; total+=1; } } printf("Kerry %d\n",Tally['K']); printf("Bush %d\n",Tally['B']); printf("Nader %d\n",Tally['N']); printf("Other %d\n",total-Tally['K']-Tally['B']-Tally['N']); return 0; }