摘要: program Project1;{$APPTYPE CONSOLE}uses SysUtils;//-------------for 语句实现----------------------------const N = 8;var Fib: array[0..8] of Integer ; i:Integer;begin Fib[0] := 0; Fib[1] := 1; for i:=2 to N do Fib[i] :=Fib[i -1] + Fib[i -2]; for i := 0 to N do Writeln(Fib[i]);R... 阅读全文
posted @ 2012-05-23 22:55 BarneyX 阅读(222) 评论(0) 推荐(0) 编辑
摘要: {没事做的时候拿一个c的杨辉三角翻译成DELPHI! 觉的D的FOR不如C的FOR好使!DELPHI杨辉三角}program Project1;{$APPTYPE CONSOLE}usesSysUtils;vari, j, l, r:integer;a:array[0..17] of integer;n:Integer = 0;begina[0]:=0;a[1]:=1;while ((n < 1)or(n > 16)) dobeginWrite('请输入杨辉三角形的行数:');Readln(n);end;for i :=1 to n dobeginl:=0;for 阅读全文
posted @ 2012-05-23 22:52 BarneyX 阅读(350) 评论(0) 推荐(0) 编辑
摘要: 消息是Windows发出的一个通知,它告诉应用程序某个事件发生了。在Delphi中,大多数情况下Windows的消息被封装在VCL的事件中,我们只需处理相应的VCL事件就可以了,但如果我们需要编写自己的控件、截获或过滤消息就必须深入研究Win32的消息处理机制。在Delphi中消息以TMessage记录的方式定义。打开Message.pas文件,我们可以看到Tmessage是这样定义的:type TMessage = packed record Msg: Cardinal; case Integer of 0: ( WParam: Longint; LParam: Longint; Resul 阅读全文
posted @ 2012-05-23 21:27 BarneyX 阅读(494) 评论(0) 推荐(0) 编辑