0

Why does it keep asking me to add new lines to separate multiple inputs? What does it mean?

#include <iostream> using namespace std; int main () { int a; //How old are you? cin>> a; return 0; }

18th Jun 2017, 7:18 PM
Harley Quinn
17 Answers
+ 7
yeah you can only run inputs at the start with Sololearn
19th Jun 2017, 12:57 AM
Ahri Fox
Ahri Fox - avatar
+ 5
you literally just hit enter button for the next line of input
18th Jun 2017, 11:46 PM
Ahri Fox
Ahri Fox - avatar
+ 3
You should really use a PC for code and copy to your mobile or email it to yourself once you're done. Mobile IDEs provide terrible debug messages. What's the error or error message? * They tend to "hide" compiler messages as far as I understand (not a mobile enthusiast, never will be)
18th Jun 2017, 8:03 PM
Jamie
Jamie - avatar
+ 2
It works like this. Line 1: input1 - first value to cin(line 1) Line 2: input2 - second value to cin(line 2)
18th Jun 2017, 7:29 PM
Manual
Manual - avatar
+ 2
I had some issues in the code that caused a runtime error. I debugged it. Thank you for pointing it out! My code just got that much better.
18th Jun 2017, 7:47 PM
Manual
Manual - avatar
+ 1
@Jamie is right, edit The only one that works well on Sololearn (SL) is the javascript interpreter.
18th Jun 2017, 7:28 PM
Manual
Manual - avatar
+ 1
Try using this code, it may make more sense https://code.sololearn.com/c9LIOvuauqq7/?ref=app
18th Jun 2017, 7:32 PM
Manual
Manual - avatar
+ 1
Thanks
18th Jun 2017, 7:35 PM
Harley Quinn
+ 1
Also why does it say time limit exceeded sometimes when you click output?
18th Jun 2017, 7:35 PM
Harley Quinn
+ 1
@Harley The runtime error and missing values. I took care of it.
18th Jun 2017, 9:15 PM
Manual
Manual - avatar
+ 1
@Jamie Thats right I used to code on mobile. Now I use my PC to write code. Only some of the code I write works on SL.
18th Jun 2017, 9:16 PM
Manual
Manual - avatar
+ 1
@Ahri Fox: You double posted... No, problem was interactive prompts. Pseudo code: a = new Person; do { a.getName(); a.chkDup(); } while (a.has("quit") == false); That example won't work because it's interactive. A text adventure is another example. Anything needing an input followed by another input later will fail unless it's finite (ex: Name, Number, Gender). That and the console rendering (should be 80x24) are the problems.
19th Jun 2017, 12:33 AM
Jamie
Jamie - avatar
0
The Solo Learn console is FAIL. I have the same issues with a Python game I made. Find another emulator and recommend people use that for your code or post non-interactive code. Nothing we can do until SL fix it.
18th Jun 2017, 7:23 PM
Jamie
Jamie - avatar
0
Pointing what out?
18th Jun 2017, 7:54 PM
Harley Quinn
0
How did you debug it?
18th Jun 2017, 7:55 PM
Harley Quinn
0
Debug messages?
18th Jun 2017, 8:36 PM
Harley Quinn
0
@Manual: Yeah, for C/C++ it's worse. At least with Python QPython runs most code. But I think it's okay to post code for PC on SL because many are complaining they want full PC access next update and/or better emulator. Fingers crossed :)
19th Jun 2017, 12:38 AM
Jamie
Jamie - avatar