delphi一句话帮助终[2]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 u2m 的 blog

      aromans: array[1..13] of string = ('i', 'iv', 'v', 'ix', 'x', 'xl', 'l', 'xc',

         'c', 'cd', 'd', 'cm', 'm');

      aarabics: array[1..13] of integer = (1, 4, 5, 9, 10, 40, 50, 90, 100, 400,

         500, 900, 1000);

var

      i: integer;

begin

      result := '';

      for i := 13 downto 1 do

        while (idecimal >= aarabics[i]) do

        begin

           idecimal := idecimal - aarabics[i];

           result := result + aromans[i];

        end;

end;

 

procedure tform1.button1click(sender: tobject);

begin

      showmessage(dectoroman(5));

end;

3.       格式化整数显示

本文关键:delphi 技巧
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top