Last active
May 18, 2017 14:52
-
-
Save lrlucena/c3bd0436f1d940bdd3a256de32790689 to your computer and use it in GitHub Desktop.
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
# Numeros ímpares | |
para i de 1 até 20 passo 2 faça | |
# se i mod 2 == 1 então | |
escreva i | |
# fim | |
fim |
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
# Imprimir posição e valor | |
lista = ["TADS", "IFRN", "Natal"] | |
para i de 1 até lista.tamanho faça | |
nome = lista[i] | |
escreva "{i} - {nome}" | |
fim |
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
# Lista mutável | |
a = [1,2,3,4].mutável | |
para i de 1 até a.tamanho faça | |
a[i] := a[i] * 2 | |
fim | |
escreva a | |
a = [2, 4, 7] | |
b = [7, 1, 2] | |
c = a.mutável | |
para i de 1 até 3 faça | |
c[i] := a[i] + b[i] | |
fim | |
escreva c |
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
lista = ["TADS", "IFRN", "Redes", "Fisica"] | |
para nome em lista faça | |
escreva nome | |
fim | |
notas = [8.7, 5.8, 9.6, 8.9, 7.6] | |
var soma:= 0.0 | |
para nota em notas faça | |
soma := soma + nota | |
fim | |
media = soma / notas.tamanho | |
notas = [8.7, 5.8, 9.6, 8.9, 7.6] | |
var maior:= 0.0 | |
para nota em notas faça | |
se nota > maior então | |
maior := nota | |
fim | |
fim | |
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
# Imprimir posição e valor | |
cursos = ["TADS", "Redes", "Gestão", "Fisica"] | |
turnos = ["Manhã", "Tarde"] | |
para turno em turnos faça | |
para curso em cursos faça | |
escreva "{curso} - {turno}" | |
fim | |
fim |
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
imprima "Qual o valor de n? " | |
n = leia_inteiro | |
var soma := 0 | |
para i de 0 até n faça | |
soma := soma + i | |
fim | |
escreva soma |
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
# tabuada | |
escreva "Tabuada" | |
imprima "Qual o número? " | |
n = leia_inteiro | |
para i de 0 até 9 faça | |
escreva "{n} x {i} = {n*i}" | |
fim | |
# 3 x 1 = 3 | |
# 3 x 2 = 6 |
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
# tabuada | |
n = leia_inteiro | |
escreva "<html>" | |
escreva "<body>" | |
escreva "<table border='2'>" | |
para i de 0 até 9 faça | |
escreva "<tr><td>{n} x {i}</td>" | |
escreva "<td>=</td><td>{n*i}</td></tr>" | |
fim | |
escreva "</table>" | |
escreva "</body>" | |
escreva "</html>" | |
# 3 x 1 = 3 | |
# 3 x 2 = 6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment