Created
March 11, 2020 23:35
-
-
Save osnipezzini/76de5e33556374954a1f7e3074b97023 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
program SelecaoEncadeada; | |
var resposta: string; | |
begin | |
WriteLn('Escolha o tipo de animal : (R)Reptil (M) Mamifero (A) Ave '); | |
Readln(resposta); | |
if resposta = 'M' then | |
begin | |
Write('(Q) Quadrupe (A) Aquaticos ? '); | |
Readln(resposta); | |
if resposta = 'Q' then | |
begin | |
Write('(C) Carnivoro (H) Herbivoro'); | |
ReadLn(resposta); | |
if resposta = 'C' then | |
begin | |
resposta := 'Leão'; | |
end | |
else | |
begin | |
resposta := 'Cavalo'; | |
end; | |
end | |
else | |
begin | |
resposta := 'Baleia'; | |
end; | |
end | |
else if resposta = 'R' then | |
begin | |
Write('(C) Carnivoro (P) Sem Patas (A) Com Casco'); | |
Read(resposta); | |
if resposta = 'C' then | |
begin | |
resposta := 'Crocodilo'; | |
end | |
else if resposta = 'P' then | |
begin | |
resposta := 'Cobra'; | |
end | |
else | |
begin | |
resposta := 'Tartaruga'; | |
end; | |
end | |
else if resposta = 'A' then | |
begin | |
Write('(N) Não voadora (R) Rapina'); | |
ReadLn(resposta); | |
if resposta = 'N' then | |
begin | |
Write('(T) Tropical (P) Polar'); | |
ReadLn(resposta); | |
if resposta = 'T' then | |
begin | |
resposta := 'Avestruz'; | |
end | |
else | |
begin | |
resposta := 'Pinguim'; | |
end; | |
end | |
else | |
begin | |
resposta := 'Aguia'; | |
end; | |
end | |
else | |
begin | |
WriteLn('Resposta Inválida'); | |
end; | |
WriteLn('O animal escolhido foi : ' + resposta); | |
ReadLn(resposta); | |
end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment