AYUDA!!! Progamacion Pascal
{primer programa después el otro}
program signozd;
uses
crt, dos;
const
meszodiaco : array[1..12] of string[11] = (
'CAPRICORNIO','ACUARIO','PISCIS','ARIES','TAURO',
'GEMINIS','CANCER','LEO','VIRGO','LIBRA','ESCORPIO',
'SAGITARIO');
type
string10 = string[10];
string11 = string[11];
var
nombre : string[30];
i : integer;
mes : string10;
diafe, mesfe : string[2];
anofe : string[4];
salir : char;
y, m, d, dow : Word;
edad, anosna, error : integer;
function zodiaco(mes : string10) : string11;
var
m, d : string[2];
ed, er, ms, di : integer;
begin
zodiaco := ' ';
m := copy(mes,4,5);
d := copy(mes,1,2);
val(d,di,er);
val(m,ms,ed);
if ((ms = 12) and (di in[22..31])) or ((ms = 1) and (di in[1..20])) then
zodiaco := meszodiaco[1];
if ((ms = 1) and (di in[21..31])) or ((ms = 2) and (di in[1..19])) then
zodiaco := meszodiaco[2];
if ((ms = 2) and (di in[20..29])) or ((ms = 3) and (di in[1..20])) then
zodiaco := meszodiaco[3];
if ((ms = 3) and (di in[21..31])) or ((ms = 4) and (di in[1..20])) then
zodiaco := meszodiaco[4];
if ((ms = 4) and (di in[21..30])) or ((ms = 5) and (di in[1..21])) then
zodiaco := meszodiaco[5];
if ((ms = 5) and (di in[22..31])) or ((ms = 6) and (di in[1..21])) then
zodiaco := meszodiaco[6];
if ((ms = 6) and (di in[22..30])) or ((ms = 7) and (di in[1..23])) then
zodiaco := meszodiaco[7];
if ((ms = 7) and (di in[24..31])) or ((ms = 8) and (di in[1..23])) then
zodiaco := meszodiaco[8];
if ((ms = 8) and (di in[24..31])) or ((ms = 9) and (di in[1..23])) then
zodiaco := meszodiaco[9];
if ((ms = 9) and (di in[24..30])) or ((ms = 10) and (di in[1..23])) then
zodiaco := meszodiaco[10];
if ((ms = 10) and (di in[24..31])) or ((ms = 11) and (di in[1..22])) then
zodiaco := meszodiaco[11];
if ((ms = 11) and (di in[23..30])) or ((ms = 12) and (di in[1..21])) then
zodiaco := meszodiaco[12];
end;
procedure entradas;
var
tec : char;
termi : boolean;
cd1, cm1, ca1 : integer;
dia, mese : string[2];
ano : string[4];
er1, er2, er3 : integer;
begin
clrscr;
gotoxy(10,3);write('Entre Nombre : ');
gotoxy(25,3);read(nombre);
gotoxy(10,4);write('Entre Fecha Nacimiento = Dia/Mes/A¤o : / / ');
gotoxy(10,5);write('Formato = 01/03/2011');
cd1 := 1;
termi := false;
gotoxy(49,4);
repeat
tec := readkey;
if tec in[#48..#57] then
begin
dia[cd1] := tec;
dia[0] := chr(cd1);
gotoxy(48 + cd1,4);write(dia[cd1]);
cd1 := cd1 + 1;
end;
until cd1 > 2;
cm1 := 1;
gotoxy(52,4);
repeat
tec := readkey;
if tec in[#48..#57] then
begin
mese[cm1] := tec;
mese[0] := chr(cm1);
gotoxy(51 + cm1,4);write(mese[cm1]);
cm1 := cm1 + 1;
end;
until cm1 > 2;
ca1 := 1;
gotoxy(55,4);
repeat
tec := readkey;
if tec in[#48..#57] then
begin
ano[ca1] := tec;
ano[0] := chr(ca1);
gotoxy(54 + ca1,4);write(ano[ca1]);
ca1 := ca1 + 1;
end;
until ca1 > 4;
diafe := copy(dia,1,2);
mesfe := copy(mese,1,2);
anofe := copy(ano,1,4);
end;
begin
clrscr;
textcolor(15);
GetDate(y,m,d,dow);
entradas;
clrscr;
writeln('Tu Nombre Es : ',nombre);
writeln('Tu Signo Del Zodiaco Es : ',zodiaco(diafe + '/' + mesfe + '/' + anofe));
val(anofe,anosna,error);
edad := y - anosna;
writeln('Tu Edad Es De : ',edad,' A¤os');
writeln('**** Pulsa [ ENTER ] Para Finalizar ****');
repeat
salir := readkey;
until salir = #13;
end.