You have to specify exactly what is a string and what is an integer. If string is everything that is not an integer, first attempt to read input as an integer, and if that fails, read it as a string....