Q:

Java. "Enter" as a new line,not submission

how to input 
1 2  
4 5 4 2 3  
1 2 1 1 1

to cmd?
I don't want "1 2" to be read when I press "Enter" but to go to next line and write "4 5 4 2 3" 

A:

I'm just doing guesses here, since you really didn't give me much to work with, but did you consider using the escape character () to escape newlines?
Alternatively, just create a loop that keeps reading until you enter an empty line:
string line;
do {
    cin >> line;
} while (line.size() > 0);

