Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Print Figures
- main :: IO()
- main = do
- line1 <- getLine
- let a = read line1 :: Int
- printTriangle a
- printTriangle2 a a
- printTriangle :: Int -> IO()
- printTriangle 0 = putStr ""
- printTriangle n = do
- putStrLn (replicate n '*')
- printTriangle (n-1)
- printTriangle2 :: Int -> Int -> IO()
- printTriangle2 0 _ = putStr ""
- printTriangle2 n m = do
- putStrLn (replicate (m-n+1) '*')
- printTriangle2 (n-1) m
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement