Your challenge is to determine whether the given input is an integer, a string, or a decimal.
- A string is any input that is not an integer or a float
- An integer must contain only numeric characters and must not start with a zero
- A decimal is any input that contains the period (
.) and the period is surrounded by numeric characters.
Note: .01 is not considered a valid decimal.
- The program should output a raw string either "string", "integer", or "decimal".
- You may assume only printable ASCII characters are used
asdf -> string asdf3.4 -> string 2 -> integer 2.0 -> decimal 02 -> string 40. -> string . -> string .01 -> string 0.0 -> decimal .9.9.9 -> string [empty space] -> string
EDIT: Fixed the typo. I meant .01 without the leading zero, not with. If that made it unclear, its fixed now!
This is code-golf, so shortest answer wins.