BlueBook
p184ex8: Voting
Given N characters C1,… CN, each denoting one vote for the corresponding candidate, determine the number of votes received by each candidate, as well as the number of spoiled ballots.
Votes for valid candidates in the election are denoted by the letters 'A' through 'F', inclusive. Any other character represents a spoiled ballot.
Input
The first line contains a single integer N (1 ≤ N ≤ 1000).The following N lines each contain a single character Ci, representing one vote.
Output
Lines 1..6 should each contain one integer, the number of votes that candidates A…F, respectively, received in the election. Line 7 should also contain one integer, the number of spoiled ballots.Sample Input
5 A B C B %
Sample Output
1 2 1 0 0 0 1
All Submissions
Best Solutions
Point Value: 4
Time Limit: 2.00s
Memory Limit: 16M
Added: Oct 29, 2008
Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3
Comments (Search)
It's quiet in here...