Why in sololearn code doesn't work correctly? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why in sololearn code doesn't work correctly?

I wrote a program on a computer. It works perfectly, but sololearn reads it not correct! Why? https://code.sololearn.com/cZdr2bZkfDnW/?ref=app https://code.sololearn.com/cZdr2bZkfDnW/?ref=app

12th Feb 2020, 5:59 PM
Majid Isaev
Majid Isaev - avatar
11 Answers
+ 2
How did you provide input Majid? Q: "Ok!! Suppose the code is not true! Then why does this code work not correct?" A: That code works correctly, what is not correct? can you describe the problem? Running codes that require interactive input in SoloLearn is tricky. See this code to understand how input works in SoloLearn: https://code.sololearn.com/WhiNb9BkJUVC/?ref=app
12th Feb 2020, 6:43 PM
Ipang
+ 3
What did you expect that you decided to use `x == x` as loop condition?
12th Feb 2020, 6:07 PM
Ipang
+ 1
Sololearn supports one and only one input. You cannot use while with input here
12th Feb 2020, 6:40 PM
Gabriel Ilie
Gabriel Ilie - avatar
+ 1
Edit: [if you asking about SL behaviour with input taking, then just need to give all the inputs at one time only.. Because, I think input take input and send to server..] If your taking about warnjngs: It is compiler dependent., may be. Different compiler behave differently.. If you taking about x==x, then it just warning for you unintentionally typed.. Because it is while loop... If you want remove that, instead of x==x, write while(true) ; it will not give any warnings.. Compiler assumes your intention is clear...
12th Feb 2020, 6:44 PM
Jayakrishna 🇮🇳
12th Feb 2020, 6:48 PM
Majid Isaev
Majid Isaev - avatar
+ 1
Not bad, just a little bit confusing, and it doesn't play nicely in SoloLearn Code Playground because it requires interactive input
12th Feb 2020, 6:58 PM
Ipang
+ 1
Thanks!))
12th Feb 2020, 7:03 PM
Majid Isaev
Majid Isaev - avatar
0
Ipang, it's clear! But why does she work on a computer perfect? That I didn't understand!
12th Feb 2020, 6:17 PM
Majid Isaev
Majid Isaev - avatar
0
On the computer the cycle restarts if you enter the wrong password. And the mistaked don't give out!
12th Feb 2020, 6:20 PM
Majid Isaev
Majid Isaev - avatar
0
Ok!! Suppose the code is not true! Then why does this code work not correct? https://code.sololearn.com/cESZA4puacFM/?ref=app
12th Feb 2020, 6:27 PM
Majid Isaev
Majid Isaev - avatar
0
Ok! I realized!
12th Feb 2020, 6:47 PM
Majid Isaev
Majid Isaev - avatar