例求兩數(shù)的最小公倍數(shù)function lcm(a,b:integer):integer;beginif a<b then swap(a,b);lcm:=a;while lcm mod b>0 do inc(lcm,a);end;
2 回答

侃侃爾雅
TA貢獻1801條經(jīng)驗 獲得超16個贊
Exchanges high order byte with the low order byte of an integer or word.
Unit
System
Category
backward compatibility routines
Delphi syntax:
function Swap(X);
Description
In Delphi code, Swap exchanges the high-order bytes with the low-order bytes of the argument. X is an expression of type SmallInt, as a 16-bit value, or Word. This is provided for backward compatibility only.
- 2 回答
- 0 關(guān)注
- 1171 瀏覽
添加回答
舉報
0/150
提交
取消