How to read numbers of n lines into a Scala list?
This is for the online judge. I am trying to learn some Scala in the process.
The input format looks like
4 543534 6756 4564 363773
So the first line is n, and then the next n lines contain the items to go to the list.
Right now I'm reading n using readInt()
, but I don't know how to say, "Now read the next n lines and put everything in a list."
+3
source to share
2 answers