Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Print the winner of the election
- void print_winner(void)
- {
- for (int i = 0; i < candidate_count; i++)
- {
- if (check_winner(i))
- {
- printf("%s\n", candidates[i]);
- break;
- }
- }
- return;
- }
- bool check_winner(int winner)
- {
- for (int j = 0; j < candidate_count; j++)
- {
- if (locked[j][winner])
- {
- return false;
- }
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement