////////////////////// /// Cheating /// /// Vote Counter /// /// By: Matti /// /// "Deewiant" /// /// Niemenmaa /// /// /// /// Just something /// /// I threw together /// /// in 15 minutes, /// /// based on the /// /// given framework. /// ////////////////////// #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)) { if (Vote != 'B' && Vote != 'N' && Vote != 'K') { ++total; } if (Vote == 'B') { ++Tally['B']; ++total; } if (Vote == 'N') { ++Tally['N']; ++total; } if (Vote = 'K') { ++Tally['K']; ++total; } } } 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']); // Not asked for in the rules, so I'll leave it out for the final version. // printf("Total: %d\n", total); return 0; }