Added user input checking

I replaced cin << some_int with some_int = get_int().
It prevents users from breaking the file stream by inputting characters when integers are expected.