5,927
社区成员




type
pNode = ^TNode;
TNode = record
//... Data
Next: pNode;
end;
function CheckCircle: Boolean;
var
pCurNode: pNode;
pTmpNode: pNode;
begin
Result:= false;
pCurNode:= FHeadNode;
while (pCurNode <> nil) do
begin
pTmpNode:= pCurNode^.Next;
while (pTmpNode <> nil) do
begin
if (pTmpNode^.Next = pCurNode) then
begin;
Result:= true;
break;
end;
pTmpNode:= pTmpNode^.Next;
end;
if Result then break;
pCurNode:= pCurNode^.Next;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
hh,mm,ss:integer;
tt:string;
begin
mm:=0;
ss:=0;
{
每次时间相差:60/(1-1/12)
}
for hh:=0 to 23 do begin
if hh mod 12 =0 then begin
mm:=5;
ss:=5*60 div 11;
end
else begin
mm:=mm+(ss+5*60 div 11)div 60;
ss:=(ss+5*60 div 11)mod 60;
end;
memo1.Lines.Add(inttostr(hh)+':'+inttostr(mm)+':'+inttostr(ss));
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
i,hh,mm,ss:integer;
tt:string;
begin
{
每次时间相差:60/(1-1/12)
}
for i:=0 to 23 do begin
if i mod 12 =0 then begin
hh:=1;
mm:=5;
ss:=5*60 div 11;
end
else begin
hh:=hh+1;
mm:=mm+(ss+5*60 div 11)div 60;
ss:=(ss+5*60 div 11)mod 60;
end;
memo1.Lines.Add(inttostr(hh)+':'+inttostr(mm)+':'+inttostr(ss));
end;
end;