Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a bug in the runoff test from W3 #228

Open
dimisb opened this issue Jan 26, 2024 · 0 comments
Open

a bug in the runoff test from W3 #228

dimisb opened this issue Jan 26, 2024 · 0 comments
Assignees
Labels
CS50x CS50x

Comments

@dimisb
Copy link

dimisb commented Jan 26, 2024

// Code passes tests:
bool vote(int voter, int rank, string name)
{
for (int i = 0; i < candidate_count; i++)
{
// should be if (strcmp(name, candidates[i].name) == 0)
if (name == candidates[i].name)
{
preferences[voter][rank] = i;
return true;
}
}
return false;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CS50x CS50x
Projects
None yet
Development

No branches or pull requests

3 participants