take input

how to take the following code?
When you get the line over 0
and when you take -1 finish
input:
1 2 3 4 1 0
3 2 1 8 4 3 2 0
1 2 0
-1
thank you for helping
Topic archived. No new replies allowed.