Changed source code such that non-integer input such as character input
should be rejected. If it still happens to get into an infinite loop,
please terminate as specified in the README file.