How to make a console calculator addition in Kotlin?

Good day, kind community. Recently, for the sake of interest checked on the platform Hyperskill, and after some time came across a problem with certain conditions. I have to say that I have no coding experience and this is my first acquaintance with the library Scanner. By the way, you can use only.
Problem: After entering the two numbers in the same row should display their sum. If you enter one number, then it should be displayed. If anything, the answer is: the program should ignore it. Continue to should all of the command entry /exit.

All wrapped into a loop and then it would not have experimented with nextInt(), hasNext (), and so on, without end break. For the second day of fighting.

Example input/output:

>17 9
26
>-2 5
3
>
>7
7
>/exit
Bye!

I would be very grateful for any guidance.
April 3rd 20 at 17:42
1 answer
April 3rd 20 at 17:44
val arr = scan.nextLine().split(" ").map{ it.trim().toInt() }.toTypedArray()

The array will contain both numbers

Find more questions by tags JavaKotlin