Skip to content

Instantly share code, notes, and snippets.

@osnipezzini
Created March 11, 2020 23:35
Show Gist options
  • Save osnipezzini/76de5e33556374954a1f7e3074b97023 to your computer and use it in GitHub Desktop.
Save osnipezzini/76de5e33556374954a1f7e3074b97023 to your computer and use it in GitHub Desktop.
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