readf(" %d",&tempy);
This leaves the \n at the end. A next readf thanks to the leading space would ignore that \n and keep going, but a readln stops at the first \n it sees, even if it is a leftover item in the buffer from a readf before.
Adam D. Ruppe via Digitalmars-d-learn Thu, 28 Jan 2021 11:35:21 -0800
readf(" %d",&tempy);
This leaves the \n at the end. A next readf thanks to the leading space would ignore that \n and keep going, but a readln stops at the first \n it sees, even if it is a leftover item in the buffer from a readf before.