An integer can be unambiguously specified in decimal, binary, octal or hexadecimal form. All of these forms can begin with an optional sign, which can be a "+" or a "-" with no separating characters between it and the rest of the integer.

A decimal integer can be a single zero or a sequence of one or more decimal digits that starts with a non-zero decimal digit. The decimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.

An octal number starts with a zero and is followed by a single zero or a non-empty sequence of octal digits that starts with a non-zero octal digit. An octal digit is one of 0, 1, 2, 3, 4, 5, 6 or 7.

A hexadecimal number starts with a zero and is followed by an upper or lower case "x", and either a single zero or

**a non-zero hexadecimal digit and a sequence of zero or more hexadecimal digits.**Hexadecimal digits include the decimal digits and the letters a, b, c, d, e and f and their uppercase versions.

Notice how long and confusing this description has to be to ensure that it is unambiguous. "Leading zeros" aren't allowed in any of the representations, e.g., 0x007 is a bad hex number, and 007 is both a bad octal number and a bad decimal number.

I guess I'm just having trouble on how to get the program to figure out what kind of number is it.