Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool print_winner(void)
- {
- // TODO
- printf("a:%i b:%i c:%i \n", candidates[1].votes, candidates[2].votes, candidates[3].votes); //Testing
- for (int i = 0; i < voter_count; i++)
- {
- if (candidates[i].votes >= voter_count / 2)
- {
- printf("%s \n", candidates[i].name);
- return true;
- }
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment