quinta-feira, 28 de outubro de 2010

Algoritimos para ler a procedencia de determinado produto (senteça Se)

Program Pzim ;
var
cod: integer;
 Begin
  write('informe o codigo');
  read(cod);
  if cod= 1 then
  write('sul')
  else
  if cod=2 then
  write('norte')
  else
  if cod=3 then
  write('leste')
  else
  if cod=4 then
  write('oeste')
  else
  if (cod=5) or (cod=6) then
  write('nordeste')
  else
  if (cod=7) or (cod=8) or (cod=9) then
  write('sudeste')
  else
  if (cod>=10) and (cod<=20) then
  write('centro oeste')
  else
  if (cod>=21) and (cod<=30) then
  write('noroeste')
  else
  write('invalido');
 End.

Nenhum comentário:

Postar um comentário