The problem is that you're telling the loop to terminate when the input is 0.
The input is never 0, the ASCII for newline is 10 so that's what you'll need to use.
This code should work. In reality, this code doesn't care at all if you've given it a number, it just returns the last character before the first newline it finds.
+[ // increment [1] by 1 and enter the loop
,[ // read input to [1] and enter another loop
>+>+<<- // copy the initial input twice whilst decrementing the original
]
>>>++++++++++ // write 10 (for newline) and enter a loop
[
<->- // decrement the 10 counter and one of the copied inputs
]
< step back to the (input - 10) cell
]<<<. // if (input - 10 == 0) then you just read a carriage return! yay! Step back by three to the last stored input and print it out to the console.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…