Skip to content

Instantly share code, notes, and snippets.

@loonix
Last active December 6, 2019 10:06
Show Gist options
  • Save loonix/5ca9d9aaded85a9fbb263af2defdc98e to your computer and use it in GitHub Desktop.
Save loonix/5ca9d9aaded85a9fbb263af2defdc98e to your computer and use it in GitHub Desktop.
[Portugol] Ver se ano e bissexto #portugol
inicio
variavel inteiro ano
variavel inteiro resto4
variavel inteiro resto100
variavel inteiro resto400
escrever "Introduza um ano: "
ler ano
resto4 <- ano % 4
resto100 <- ano % 100
resto400 <- ano % 400
se (resto4 = 0 e resto100 =/= 0) ou (resto400 = 0 ) entao// divisivel por 4 e nao divisivel por 100 ou 400 = 0
escrever ano , " e bissexto"
senao
escrever ano , " nao e bissexto"
fimse
fim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment