Implementatoito convert a string to an integer.
Hint:Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input cases.
Notes:It is intended for this problem to be specified vaguely (ie, no given input specs). You are responsible to gather all the input requirements up front.
这题关键点在于定义return值时要long型而不是int。 这样才能判断出是否越界。
1 过滤空格, 2:正负值, 3: 越界直接return