专注于互联网--专注于架构

最新标签
网站地图
文章索引
Rss订阅
// 节日算法 请参见 《农历与西历对照、万年历》unit CNYear;interfaceuses sysutils;type TCNDate = Cardinal;function DecodeGregToCNDate(dtGreg:TDateTime):TCNDate; function GetGregDateFromCN(cnYear,cnMonth,cnDay:word;bLeap:Boolean=False):TDateTime; function GregDateToCNStr(dtGreg:TDateTime):St [阅读全文] [PDF]
1.数论算法 求两数的最大公约数 function gcd(a,b:integer):integer; begin if b=0 then gcd:=a else gcd:=gcd (b,a mod B); end; 求两数的最小公倍数 function lcm(a,b:integer):integer; begin if a< b then swap(a,B); lcm:=a; while lcm mod b >0 do inc(lcm,a); end; 素数的求法 A.小范围内判断一个数是否为质数: function prime (n: integ [阅读全文] [PDF]
1 共2条 分1页