Skip to content
Advertisement

How to take n spaced input for multiple lines in java? [closed]

11 22 33

44 54 63

73 53 24

I am unable to take input in this format in java. I am comfortable with n spaced input for single line but am unable to take n spaced multiple line input used in competitive coding. Can anyone provide me an easy solution to it.

Advertisement

Answer

You can use a Scanner for this purpose:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement