Created
March 9, 2014 05:42
-
-
Save skvggor/9443353 to your computer and use it in GitHub Desktop.
Start with haskell.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-main = do | |
putStrLn "Qual é o seu primeiro nome?" | |
primeiroNome <- getLine | |
putStrLn "Qual é o seu segundo nome?" | |
segundoNome <- getLine | |
putStrLn ("Olá, " ++ primeiroNome ++ " " ++ segundoNome ++ "!") | |
-} | |
import Data.Char | |
main = do | |
linha <- getLine | |
-- Maiúscula | |
let linhaMaiuscula = map toUpper linha | |
if null linha | |
then return () | |
else do | |
putStrLn $ palavrasInvertidas linhaMaiuscula | |
main | |
palavrasInvertidas = unwords . map reverse . words | |
{-import Control.Monad | |
main = do | |
c <- getChar | |
when (c /= ' ') $ do | |
putChar c | |
main-} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment