program eje10;
uses crt;
function valido(d,m,a:integer):boolean;
begin
if (m>0) and (m<13) then
begin
case (m) of
1,3,5,8,10,12: if (d>0) and (d<=31) then
valido:=True
else
valido:=False;
2: if (a mod 4=0) and (a mod 100<>0) then
begin
if (d>0) and (d<=29) then
valido:=True
else
valido:=False;
end
else
begin
if (a mod 4=0) and (a mod 100=0) then
if (d>0) and (d<=28) then
valido:= true
else
valido:= false;
end;
4,6,7,9,11:
if (d>0) and (d<=30) then
valido:=True
else
valido:=False;
else
valido:=false;
end;
end;
end;
var
d,m,a:integer;
begin
writeln ('ingrese un dia');
readln (d);
writeln ('ingrese un mes');
readln (m);
writeln ('ingrese un ano');
readln (a);
writeln ('la fecha es: ',valido(d,m,a));
end.
Replies to Untitled
Title |
Name |
Language |
UNIX |
When |
Re: Untitled |
Angel |
pascal |
1632282574 |
2 Years ago. |
Re: Untitled |
Melodic Kitten |
pascal |
1632282413 |
2 Years ago. |
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}