本文整理自网络,侵删。
一个判断素数的简单例子:function IsPrime (N: Integer): Boolean;var Test: Integer;begin IsPrime := True; for Test := 2 to N - 1 do if (N mod Test) = 0 then begin IsPrime := False; break; {jump out of the for loop} end;end;
相关阅读 >>
Delphi andorid应用程序检查wifi有效还是无效
Delphi文件 fileopen 、fileseek等的用法(看红色字体)
更多相关阅读请进入《Delphi》频道 >>