1) Escreva um algoritmo que leia três valores inteiros e diferentes e mostre-os em ordem decrescente.
Program Condicional01 ; var a,b,c: integer; Begin Write('Informe 1º Valor: '); ReadLn(a); Write('Informe 2º Valor: '); ReadLn(b); Write('Informe 3º Valor: '); ReadLn(c); if (a>b) and (b>c) then begin WriteLN(a,b,c); end else if (b>a) and (a>c) then begin WriteLN(b,a,c); end else if (c>a) and (a>b) then begin WriteLN(c,a,b); end else if (a>c) and (c>b) then begin WriteLN(a,c,b); end else if (b>c) and (c>a) then begin WriteLN(b,c,a); end else if (c>b) and (b>a) then begin WriteLN(c,b,a); end; WriteLN(' by Marcus Vinicius'); End.
Categories:
Pascal
,
Programação
0 comentários:
Postar um comentário