Results 1 to 4 of 4

Thread:

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date: Jun:2003
    Location:
    Posts: 416

    Unhappy

    :

    Pascal 6.0 ( ), , ( 1000 ) .

    , , . , , ...

  2. #2
    XaMaB's Avatar
    Join Date: Nov:2001
    Location:
    Posts: 20,387
    .




    P.S. clubs.dir.bg
    : XaMaB; . 0.42

    In God we Trust (all others must submit a X.509 certificate). , ()

  3. #3
    Registered User
    Join Date: Jun:2003
    Location:
    Posts: 416
    google

  4. #4
    Registered User nettle's Avatar
    Join Date: Sep:2003
    Location: Sofia
    Posts: 402
    Code:
    function ConvertRom2Arab(N:string):Integer;
      {-------------------------------------------}
      function Roman(aValue:string):Integer;
      var X:Char;
      begin
        X:=UpperCase(aValue)[1];
        case X of
          'M': Result:=1000;
          'D': Result:=500;
          'C': Result:=100;
          'L': Result:=50;
          'X': Result:=10;
          'V': Result:=5;
          'I': Result:=1;
          else Result:=0;
        end;//case
      end;{Roman}
      {-------------------------------------------}
    var I:Integer; lvRet:Integer;
    begin
      lvRet:=0;
      I:=1;
      while I<=Length(N)-1 do begin
        If(Roman(N[I]) < Roman(N[I+1]))then begin
          lvRet:=lvRet+(Roman(N[I+1])-Roman(N[I]));
          Inc(I);
        end else begin
          lvRet:=lvRet+Roman(N[I]);
        end;//If
        Inc(I);
      end;//while
      If(I=Length(N))then lvRet:=lvRet+Roman(N[I]);
      Result:=lvRet;
    end;{ConvertRom2Arab}
    TP6,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |