Jerry 于 2010-10-24 22:40(14 年以前) 发表:
不才,写了一下delphi的代码:
Quote:
procedure TForm1.btn1Click(Sender: TObject);
var
beginYear,EndYear:Integer;
j,k:Integer;
begin
DateSeparator := '/';
beginYear := 2000;
EndYear := 2100;
for j := beginYear to EndYear do
begin
for k := 1 to 12 do
begin
if (k = 1) or (k = 3) or (k = 5) or (k = 7 ) or (k = 8) or (k = 10) or (k = 12) then
begin
if DayOfWeek(StrToDate(IntToStr(j)+'/'+IntToStr(k)+'/01')) = 6 then
mmo1.Lines.Add(IntToStr(j) + '--' + IntToStr(k));
end;
end;
end;
end;