scanf is a crap way of getting user input. Use fgets instead and parse the string.