首页 > 代码库 > Haskell练习

Haskell练习

题目链接

1 -- Enter your code here. Read input from STDIN. Print output to STDOUT2 import Data.List3 main = do4     inputdata <- getLine5     putStrLn . concat . map (\xs -> f (head xs) (length xs)) . group $ inputdata 6         where 7             f ch len8                 | len == 1 = [ch]9                 | otherwise = [ch] ++ show len

Haskell练习