haskell 自带的 Integer 是高精度的,很适合这个题目
Integer
因为没找到 scanl1' 所以写的代码有点奇怪,望大佬们指点
scanl1'
module Main where import Data.List main :: IO () main = read <$> getLine >>= \n -> print . sum $ scanl' (*) 1 [2 .. n]