Questions tagged [print-winner]
The print-winner tag has no usage guidance.
9
questions
0
votes
0
answers
11
views
Unsure why last check of tideman (print winner when tie occurs) is not working for me
I've tried many different ways to approach this problem, but I'm still unable to get the last check to go through:
What I did was create a data type (using struct) that has the total number of times ...
0
votes
0
answers
257
views
CS50 2022 Pset3 (Tideman) print winner works but cannot pass check50
I wrote the code according to the specifications. I had tried some examples I can imagine and was able to print out the winner correctly. But check50 said there was still something wrong with the ...
0
votes
1
answer
38
views
What's wrong with my Tabulate, Find min and Print winner?
#include <cs50.h>
#include <stdio.h>
#include <string.h>
// Max voters and candidates
#define MAX_VOTERS 100
#define MAX_CANDIDATES 9
// preferences[i][j] is jth preference for voter ...
0
votes
1
answer
672
views
(Solved) Problem Set 3 - (Tideman) Print Winner Function
I have implemented everything successfully up until the 'Print Winner Function', and although I'm pretty sure my logic is correct,
and doing manual tests myself yield the correct winner's name.
The ...
0
votes
1
answer
57
views
Problem Set 3 (Runoff) print_winner function doesn't print and quits
I am working on problem set 3 runoff and I am having trouble with getting my print_winner function to work correctly. When I run the program it basically does nothing and quits the program. It gets ...
0
votes
1
answer
159
views
CS50 - pset3 - Runoff | Check50 failing print_winner on majority but works correctly for any manual test I can think of
I'm having trouble with getting Runoff to complete Check50. All checks are passing except the two below for the print_winner function
:( print_winner prints name when someone has a majority
Cause
...
0
votes
1
answer
110
views
pset 3 tideman print winner does not exist despite being declared
I have such a strange behavior here in pset 3, tideman. I am doing the print_winner function because check50 says everything else is fine, but when i run the program it looks like print_winner does ...
0
votes
1
answer
52
views
Print winner implementation error. Can someone help?
I tried the following idea to print winner function. Can you check why it is not working?
Defined a function named find_majority. This is to get around the float problem.
called the function and ...
0
votes
1
answer
175
views
My print_winner from pset3/tideman is doing everything right and still check50 says it's wrong
void print_winner(void)
{
bool looser;
for (int i = 0; i < pair_count; i++)
{
looser = false;
for (int j = 0; j < pair_count; j++) //checks if each winner ever lost ...