Back to task

256 symbols haskell
Fri Jun 27 03:40:56 2014 salvipeter
import Control.Arrow
import Data.Function
import Data.List
r x=(a,read b)where[a,b]=words x
a x=map(fst.head&&&foldr1(+).map snd)$groupBy(on(==)fst)$sortBy(on compare fst)x
s(a,b)=a++' ':show b
main=do{p<-fmap(map r.lines)getContents;mapM_(putStrLn.s)$a p}


Leave a comment

Parsed as Markdown

Login to leave a comment