+ 1

Why this message displays when I do run for program that include (cin >>)?

This is a message: Looks like your program needs input split multiple inputs into separate lines https://code.sololearn.com/cYSmiwHgeyyq/?ref=app https://code.sololearn.com/cYSmiwHgeyyq/?ref=app

19th Aug 2019, 1:58 PM
Nashwan Saeed Nejad
Nashwan Saeed Nejad - avatar
4 Antworten
+ 2
cin takes user input. All inputs on sololearn (except web) are displayed this way. Because input is poorly made here, it takes all inputs at once. So, if you have: int x, y; cin >> x >> y; And if you input: 3 6 x will have the value 3, and y will have the value 6.
19th Aug 2019, 2:32 PM
Airree
Airree - avatar
+ 1
It does that to keep things organized. Let's say you have two variables: x and y. If you want to have those variables store an input, they need to be on separate lines. For example: If you input 12 on one line, the value of 'x' will be 12 and 'y' will not not have a stored value. But if you input 1 2 the value of 'x' will be 1, and the value of 'y' will be 2.
19th Aug 2019, 2:36 PM
UrBoyO
UrBoyO - avatar
+ 1
Limitations of Sololearn platform.
19th Aug 2019, 3:25 PM
Miquel Andreu Fuster Sancho
Miquel Andreu Fuster Sancho - avatar
0
When you use cin >> you're requesting something to the user of your program. For my experience, SoloLearn only lets you ask for input once in the program. So, if you want to run properly the program you post here, it must be executed in a computer.
19th Aug 2019, 2:40 PM
Sara
Sara - avatar