|  | 
 
 发表于 7-9-2006 06:16 PM
|
显示全部楼层 
| program Project1; 
 {$APPTYPE CONSOLE}
 
 uses
 SysUtils;
 var
 x:integer;
 num : array of integer;
 max
  nteger; begin
 
 SetLength(num,3);
 
 { TODO -oUser -cConsole Main : Insert code here }
 
 //1,2,3,5,8,13,21,34....
 
 max := 60;
 x := 1;
 num[0] := 1;
 num[1] := 1;
 num[2] := 1;
 while num[2] <= max do begin
 Writeln(inttostr(num[2]));
 
 num[2] := num[0] + num[1];
 num[0] := num[1];
 num[1] := num[2];
 end;
 
 Readln;
 
 end.
 
 
 用delphi写的...
  | 
 |