replicate + interact => 3 lignes

master
Karchnu 2016-01-23 01:05:34 +01:00
parent e71053e3b8
commit 499fa18707
1 changed files with 3 additions and 0 deletions

3
haskell/columnv7.hs Normal file
View File

@ -0,0 +1,3 @@
import Data.List
main = do interact $ (unlines . map unwords . transpose . map (completeMatrix ' ') . transpose . completeMatrix "" . map words . lines)
where completeMatrix v m = map (\e -> e ++ replicate ((maximum $ map length m)- length e) v) m