• + 0 comments

    Using unbounded arrays

    eToX = \x -> sum $ take 10 $ map (\n -> x^n / fromIntegral (product [1..n])) [0..]
    main = interact $ unlines . map show . map (eToX . read) . tail . words