--打印直角三角形。import Control.Monadmain n = mapM_ print (map (\x -> replicate x '*') [1..n])
--打印等腰三角形,第n行有2n-1个*号。import Control.Monadmain n = mapM_ print (map (\x -> (replicate (n-x) ' ')++(replicate (2*x-1) '*')++(replicate (n-x) ' ')) [1..n])