codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
import System fib = 0:0:zipWith (+) fib (tail fib) at0 = (!!) at1 xs n = impl xs n 0 where impl (x:xs) 0 _ = x impl (x:xs) n _ = impl xs (n-1) $ x at2 xs n = impl xs n 0 where impl (x:xs) 0 _ = x impl (x:xs) n _ = impl xs (n-1) $! x main = do args <- getArgs print $ (at2 fib) $ read $ args !! 0
Private
[
?
]
Run code
Submit