本文整理自网络,侵删。
一个判断素数的简单例子: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 string.split 按照任意字符串分割语句
Delphi tidhttp+tidssliohandlersocket+ssl
Delphi xe5 android 使用system.zip单元释放资源文件
更多相关阅读请进入《Delphi》频道 >>