improved scanf() to handle numeric types.