Simplifing the example code to illustrate scan() and gets().