Normally, when asking for user-input a cout should be used to indicate what type of input you are looking for and to let the user know you're actually looking for input. Also, you're trying to get a character (D, E, S) and store it in an integer. x being a char data type would fix this.