You might want to cin into a char variable and then check if it the ENTER key, and if not, continue getting characters and turn them into an int (using character substraction and all that). It is not a very pretty solution but it is the first thing that came into my head.