Hi, can someone please tell me how to read the inp...
# getting-started
s
Hi, can someone please tell me how to read the inputs mentioned below.
l
call readln() twice ?
do you have a sample input ? the format of the line 1 isn’t clear
s
image.png
4 is the size of array, followed by 4 integers that needs to be in array, and then some number in nextline, it is easy to do in c++ but here I am stuck 🙂
l
readln().split(' ’)
look like a jetbrain academy exercise
s
image.png
this is how I have done this, but still giving some number format exception
l
val myarray = readln().split(’ ’) this should be enough.
you can deal with the conversion to int when using the values later
i have to go, good luck 🙂
a
Also I would advice you to use Intellij Community Edition (or Ultimate if you are a student) instead of VSCode :)
1
s
sure @Ayfri, this is just some online editor I was using to solve a competitive problem, however I still don’t think that I was able to explain the question I posted above , Referring the screenshot below, from Ist line I want first digit (4) to sore in an int variable and next four digits (1, 2,3 ,4 ) to be stored in separate integer array, how can I do this please.