I am doing the problem set 3 of CS50, called plurality. When I test my code, it gives me the right anwsers. In other words, it gives me the right winner of the election. If there are two or more winners, it also gives me their names. However, when I test the code with check50 I obtain the following:
:) plurality.c exists
:) plurality compiles
:) vote returns true when given name of first candidate
:) vote returns true when given name of middle candidate
:) vote returns true when given name of last candidate
:) vote returns false when given name of invalid candidate
:) vote produces correct counts when all votes are zero
:) vote produces correct counts after some have already voted
:) vote leaves vote counts unchanged when voting for invalid candidate
:( print_winner identifies Alice as winner of election
print_winner function did not print winner of election
:( print_winner identifies Bob as winner of election
print_winner function did not print winner of election
:( print_winner identifies Charlie as winner of election
print_winner function did not print winner of election
:( print_winner prints multiple winners in case of tie
print_winner function did not print both winners of election
:( print_winner prints all names when all candidates are tied
print_winner function did not print all three winners of election
I really don't know what do I have to change. Here is my code:
[snip code]
// Number of candidates
int candidate_count, voter_count;
[snip code] (removed solution code)