procedure TForm1.Button1Click(Sender: TObject); var queue:TQueue; i:integer; s:string; begin queue.head:=1; queue.tail:=1; for i:=1 to 9 do begin queue.data[queue.tail]:=strtoint(inputbox('请输入一个数吧','输入吧','')); queue.tail:=queue.tail+1; end; while(queue.head<queue.tail) do begin s:=s+inttostr(queue.data[queue.head]); showmessage(s); queue.head:=queue.head+1; queue.data[queue.tail]:=queue.data[queue.head]; queue.head:=queue.head+1; queue.tail:=queue.tail+1; end; showmessage(s); end;
标签:begin,head,队列,tail,queue,实现,QQ号 From: https://www.cnblogs.com/zhusd/p/17226748.html