You should read the input into a string then. If the input matches "x", exit, otherwise parse the string into an int. (A stringstream can help.)


Start by changing BinSearch to account for the...