Why when I 'm running my code from " my code bits" it is displayed " No output" , although it is solved in code coach? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

Why when I 'm running my code from " my code bits" it is displayed " No output" , although it is solved in code coach?

https://code.sololearn.com/cWQ7V9knR5P5/?ref=app

29th Apr 2022, 7:39 AM
Egor Tonchev(EGO)
Egor Tonchev(EGO) - avatar
4 Answers
29th Apr 2022, 12:32 PM
Egor Tonchev(EGO)
Egor Tonchev(EGO) - avatar
+ 2
C++ Playground doesn't recognise scanf() as a method to read user's input, that's why the input dialog isn't poping up asking for user input. scanf() works if you save the code as C code bit, not as C++ code bit.
29th Apr 2022, 8:26 AM
Ipang
+ 2
Egor Tonchev(EGO) You are using C++, but you are using C style programming. I have a solution. It is very short and simple. I am tempted to post it, but it is more helpful to you if you can figure it out on your own. Hint: 1. Use cin 2. Do not use char arrays 3. No need for cstring, strtok and strcmp
29th Apr 2022, 12:29 PM
Bob_Li
Bob_Li - avatar
+ 1
It is a failure in Sololearn's programming. Sololearn's C++ batch processor does not recognize scanf as an input statement, so it does not prompt for input.
29th Apr 2022, 8:27 AM
Brian
Brian - avatar