+ 4
Giveaway answer fields in challenges
Hi everyone. I was wondering whether it would be possible to change the way we input the answer to “What is the output of this code?” questions, at least in challenges; otherwise, the number of characters required will often give the answer away. For example, the question below should presumably test one’s understanding of the && operator, but since the output must be 7 or 10, and the answer can only be one character in length, it isn’t necessary to worry about the actual question! What is the output of this [c++] code? int x = 7; int y = 3; if (x > 5 && y < 2) cout << x + y; else cout << x - y; Just a thought... 😁
4 ответов
+ 15
Not a bad idea, although in your example, it's easy to use 6 instead of 7 and fix the problem:
int x = 6; int y = 3;
if (x > 5 && y < 2)
cout << x + y;
else
cout << x - y;
i like it when i see that the challenge creators have taken care of it in a creative way.
+ 11
Agreed, I've also noticed
+ 10
I agree and if I remember right once asked the community a very similar question but there was not much support for changing things.
+ 3
Good point, there’s probably usually a way to fix the questions themselves, which would be a lot simpler. I have seen quite a few where it’s possible to “cheat”, though.