0

I ran plurality according to spec and was able to print out all winners correctly. check50 says I didn't. What could be the problem? Is there any way to see what check50 used as inputs for plurality? Thank you for your help!

  • Can you post the check50 output? Also, the link to the result would be helpful too. – Cliff B Mar 29 '20 at 18:37
  • Output from check50 is this: :( print_winner prints multiple winners in case of tie print_winner function did not print both winners of election. My output did print out what I saw as correct: multiple winners, single winner, etc. – jinmeadow Mar 29 '20 at 21:06
  • 1
    check50 expects very exact output. Any variations (extra or missing whitespace, line feeds, punctuation, etc.) will cause problems. Also anything that doesn't exactly match what the spec wants as output will result in a fail. I'd have to see your code to diagnose it further. – Cliff B Mar 30 '20 at 4:50
  • Thank you @CliffB I had a extra space! – jinmeadow Mar 30 '20 at 16:51
0

At the end of the tests after running check50, there should be a line which says:

To see the results in your browser go to https://submit.cs50.io/check50/...

The link should give you more data about the test cases.

  • The link did not help. It displayed a frown face that said this: :( print_winner prints multiple winners in case of tie print_winner function did not print both winners of election. Whereas my output did print all the correct winners if there is more than one, and the correct one when there was only one winner. – jinmeadow Mar 29 '20 at 20:37
  • It would have helped if I could use whatever check50 used as inputs, just one of them that generated the error would help... I had printf to disply winner(s)' winning number of votes and each candidate's vote count. They were all correct. – jinmeadow Mar 29 '20 at 20:48
  • If you know that your code outputs the right answer, read the instructions again to make sure you are printing the names correctly. Make sure there are no extra spaces at the end and that you print a newline character at the end. – TLH Mar 30 '20 at 3:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .