The challenge is simple: Determine the type of an input, and output an identifier telling what type it is.
- "UI", Unsigned integer:
0
,1
,34
,111111111111111111111111111111111111111111
- "SI", Signed integer:
+0
,+1
,+42
,-1
,-3
,-111111111111111111111111111111111111111111
- "UD", Unsigned decimal:
0.0
,1.23
,1234.1234
- "SD", Signed decimal:
-0.0
,+0.0
,-1.235
- "LE", Letter:
a
-z
andA
-Z
- "SY", Symbol: ASCII code points:
[32-47, 58-64, 91-96, 123-126]
(i.e. all characters except numbers and letters) - "ST", String: Two or more character that can't be parsed as any of the above number formats
Rules:
- The input will be 1-99 characters long
- The input will only contain printable ASCII characters, code points: 32-126.
- The output should be the two identifier letters as defined above (UI, SI ...)
- Standard I/O rules apply
Examples:
UI:
0
01
34
12938219383278319086135768712319838871631827319218923
SI:
-0
+01
+1
-123
+123
UD:
0.0
3.1415
2.718281828459045235360287471352662497757
SD:
+0.0
-3.1415
+2.718281828459045235360287471352662497757
LE:
a
k
L
Z
SY:
@
"
+
-
ST:
Hello, World!
f2!"
+23df
1234A
'"!
.012
1.
UI
+-1
5+3
SY
be more than one character? \$\endgroup\$ – FryAmTheEggman Mar 31 '16 at 15:27111111111111111111111111111111111111111111
to be of integer type. \$\endgroup\$ – Matt Mar 31 '16 at 16:31uint8
orint64
, but it's definitely an integer. \$\endgroup\$ – Stewie Griffin Mar 31 '16 at 21:35