Haskell as Plain Text
Plain text
code posted
created at 28 Oct 19:19, updated at 28 Oct 19:21
Edit
|
Back
1 2 3 4 5 6 7 8 9 10 11 |
import qualified Data.Map as M
fib n = fib' n
where
fib x =
if x < 2 then
x
else
fib (x - 1) + fib (x - 2)
main = interact $ show . fib . read
|
224 Bytes in 2 ms with coderay