+ 1
This code playground is funny
Well, when i tried to make code for challenging code coach (missing number) i found the code playground runs differently. Here is the code: https://sololearn.com/compiler-playground/cLN9ztAyqoBM/?ref=app Does this bug new or it is already here for a long time?
6 ответов
+ 4
There are several problems with your code.
Sololearn playground does not play nicely with endless loops. And at the end of your do..while, you are trying to compare an integer (i) with a string "" which does not make sense.
For the code coach usually it is sufficient to ask for a single input (or a fixed number of inputs) rather than using a while loop.
If you need to provide multiple inputs on Sololearn, you can enter them in the same popup window on separate lines.
+ 2
Finally, i finished the missing number challenge (as challenge instruction). Here's the code:
https://www.sololearn.com/coach/90?ref=app
+ 1
Celvien Kurniawan
the challenges usually provides you with the number of inputs as the first integer, or if not, the number of inputs is stated in the problem.
You can put the values into that same sized array using a for loop, or just collect them to variables using multiple scanf.
Then you process those numbers to get the desired result.
+ 1
Bob_Li Oh! So its like that... I think the challenge asking me to input all those number (which who knows the amount of data listed).
edit: oops, looks like i overlooked the first input number as the 'n' of data inputs.
+ 1
Tibor Santa i use the while loop in the code with assumption that i don't know how many input the challenge gives. So i use loop operation to make the input program more flexible.
but to tell you the truth, i'm still stumbled in creating one. because i just only completed the challenges that mostly uses string for operation, recently.
0
Well, the task of the codecoach does include the code to handle multiple input. But in this case it uses newline instead of space, and it is my first time to challenge this task in sololearn. So, yeah there are many mistake in my code.
Tbh i still figuring out how to make it.