I gave the right output, but... | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

I gave the right output, but...

On C++ Exercise 6.2: Sharing is Caring, it asks you to swap two variables. I did that and my output matches expected output but it is still wrong? Why? Question: David and Alex each have aquariums. There are 8 Rainbowfishes in David’s aquarium, and 11 Angelfishes in Alex’s aquarium. Help them exchange their fishes between them. Complete the code to swap the values of variables between aquariumDavid and aquariumAlex. Here is my code. The output matches what is asked. https://code.sololearn.com/cvC5LioN09T8/?ref=app

16th Jan 2021, 1:53 AM
Chris
Chris - avatar
9 Answers
+ 4
Chris It's a bug. In test case output there is scroll. I think that maybe the reason or there maybe some other language (russian or any other language) character in output like last time we faced in one problem. I reported it but didn't get reply.
16th Jan 2021, 8:03 AM
A͢J
A͢J - avatar
+ 5
Has to be some bug. The code actually matches the algorithm to do so.
16th Jan 2021, 2:26 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 4
I have heard rumours that this perticular question is buggy.
16th Jan 2021, 2:03 AM
Arsenic
Arsenic - avatar
+ 2
The bug seems to be fixed, because you can now pass the test without trying to guess the number of spaces!
18th Jan 2021, 4:39 PM
Jan
Jan - avatar
+ 2
Cheers guys! I just ran my code and it works. Thank you all!!
18th Jan 2021, 4:47 PM
Chris
Chris - avatar
+ 1
Can anyone share the photo of expected results and ur codes result
16th Jan 2021, 3:45 AM
Steve Sajeev
Steve Sajeev - avatar
+ 1
It's hopeless trying to guess that. I just tried, but I succeeded in being able to scroll my own output to the left. Good luck to the one that guesses it!
17th Jan 2021, 2:33 PM
Jan
Jan - avatar
+ 1
Chris The bug is fixed now. The problem was in output. There was scroll.
18th Jan 2021, 4:46 PM
A͢J
A͢J - avatar
- 1
It either contains a lot of spaces or a lot of "\t" characters in the end of the last text line, or if it is the first text line, then they must be placed before the line break, because you can scroll the expected output to the left, so the solution must be to guess how many there are of either spaces or "\t" characters in one or both of the text lines.
17th Jan 2021, 12:52 PM
Jan
Jan - avatar