Solution to String To Int from Jobdu

13 Sep

Question (in Chinese):

Question Name: String To Int

Question Description: Convert the input string into an integer. The input string may or may not represent a valid and non-overflow integer.

Input: the input might contain multiple test cases. Each line is a test case (-10000000 <= integer <= 10000000).

Output: print the integer if the input string is a valid and non-overflow integer. Otherwise, print “My God”.

The solution is:

Leave a Reply

Your email address will not be published. Required fields are marked *

Please put your code into a <pre>YOUR CODE</pre> section. Thanks and Happy Coding!