Middle three digits: Difference between revisions

no edit summary
(→‎{{header|Rust}}: Update to Rust 0.8 syntax)
No edit summary
Line 2,396:
Input: -2002 Result: Not odd number of digits!
Input: 0 Result: Too few digits! </pre>
 
=={{header|Wart}}==
 
<lang wart>def (mid3 n)
withs (digits (with outstring # itoa
(pr abs.n))
max len.digits
mid (int max/2))
if (and odd?.max (max >= 3))
(digits mid-1 mid+2)</lang>
 
=={{header|XPL0}}==
143

edits