Fixed Infinite Looping Issue

Infinite loop after hasNextInt returned false corrected.