well the first problem that you have is that your while statement will infinitely loop as that is set to true.
What you might want to do is use regex and treat the while statement as a conditional statement only difference being that it will do the instructions until the condition is false.
@TC: What are you actually trying to accomplish? You are already required to press Enter to input the integer in the first place, so does that mean you really don't want a loop at all? Or do you want to read integers until the user enters a blank line? Or something else?