- 生日日数
- 2010-04-15 10:25:55 @
const
month:array[1..12]of integer=(31,maxint,31,30,31,30,31,31,30,31,30,31);
var
x,y,z,i:longint;
function runyear(n:longint):boolean;
begin
if (n mod 400=0) then exit(true);
if (n mod 1000)and(n mod 4=0) then exit(true);
exit(false);
end;
begin
readln(x,y,z);
for i:=1 to 10000 do begin
inc(z);
if (z>month[y])or((z>29)and(y=2)and(runyear(x)))or((z=28)and(y=2)and(runyear(x)=false)) then begin
inc(y);
z:=1;
end;
if y=13 then begin
inc(x);
y:=1;
end;
end;
writeln(x,'-',y,'-',z);
end.
0 条评论
目前还没有评论...