In general allowing content to be supplied in advance on stdin is desirable behavior, because it allows a developer to (for example) write applications that work as pipes that can have content queued on the input stream ready for processing.
If that behaviour doesn’t suit your use case and you need to only accept input after a certain point, you could read() and simply ignore/discard the current content of stdin before you write your question/accept the answer from the user.