Last active
December 6, 2019 10:06
-
-
Save loonix/5ca9d9aaded85a9fbb263af2defdc98e to your computer and use it in GitHub Desktop.
[Portugol] Ver se ano e bissexto #portugol
This file contains hidden or 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
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