RosettaCodeData/Task/Middle-three-digits/Klingphix/middle-three-digits.klingphix
2023-07-01 13:44:08 -04:00

14 lines
352 B
Text

include ..\Utilitys.tlhy
( 123 12345 1234567 987654321 10001 -10001 -123 -100 100 -12345 1 2 -1 -10 2002 -2002 0 )
len [
get ( dup " : " ) lprint
abs tostr len >ps
tps 3 < ( ["too short" ?]
[ tps 2 mod ( [tps 2 / 3 slice ?] ["is even" ?] ) if]
) if
ps> drop drop
] for
" " input