Skip to content

Instantly share code, notes, and snippets.

@skvggor
Created March 9, 2014 05:42
Show Gist options
  • Save skvggor/9443353 to your computer and use it in GitHub Desktop.
Save skvggor/9443353 to your computer and use it in GitHub Desktop.
Start with haskell.
{-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