- functionDecToRom(Dec:LongInt):String;
- const
- Nums:Array[1..13]ofInteger=
- (1,4,5,9,10,40,50,90,100,
- 400,500,900,1000);
- RomanNums:Array[1..13]ofstring=
- ('I','IV','V','IX','X','XL',
- 'L','XC','C','CD','D','CM','M');
- var
- i:Integer;
- begin
- Result:='';
- fori:=13downto1do
- while(Dec>=Nums[i])do
- begin
- Dec:=Dec-Nums[i];
- Result:=Result+RomanNums[i];
- end;
- end;
生成罗马数字的Delphi函数
最新推荐文章于 2020-07-30 18:48:05 发布