English
Source / code snippets

Integer novel Römische Digits - 2

 

Andreas
Miethe


à ¼ just how? römische Digits konvertieren.
CompileMarkSeparation
'##############################################
'# Autor           : ampsoft (Andreas Miethe) #
'# Thema           : Integer zu Römisch       #
'# XProfan-Version : 11                       #
'##############################################

Proc IntToRoman

    PARAMETERS Decimals&
    Var result$ = ""
    Declare Romans$[]
    Declare Arabics$[]
    Var Romans$ = "I,IV,V,IX,X,XL,L,XC,C,CD,D,CM,M"
    Var Arabics$ = "1,4,5,9,10,40,50,90,100,400,500,900,1000"
    Romans$[] = Explode(Romans$, ",")
    Arabics$[] = Explode(Arabics$, ",")

    whileloop 12,0,-1

        While Decimals& >= Int(Arabics$[&loop])

            Decimals& = Decimals& - Int(Arabics$[&loop])
            Result$ = Result$ + Romans$[&loop]

        EndWhile

    EndWhile

    Return Result$

EndProc

CLS
Print IntToRoman(2013)
WaitInput
End
 
XProfan X2
Gruss
Andreas
________ ________ ________ ________ _
Profan 3.3 - XProfanX2
Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit
ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher
Homepage :  [...] 
06/01/13  
 




Julian
Schmidt
Crazy I or there not too the ↁ as 5000, or sometimes too A written.

The to be nuts, The roman!
 
XProfan X2
Win7 Professional, SP1, AMD FX(tm)-8350 Eight-Core Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
06/01/13  
 




Andreas
Miethe


Julian Schmidt (01.06.13)

Crazy I or there not too the ? as 5000, or sometimes too A written.

The to be nuts, The roman!


already correctly., and ↂ for 10000.
You must the gladly strain
 
XProfan X2
Gruss
Andreas
________ ________ ________ ________ _
Profan 3.3 - XProfanX2
Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit
ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher
Homepage :  [...] 
06/01/13  
 




Julian
Schmidt
Okay, so.
CompileMarkSeparation
'##############################################
'# Autor           : ampsoft (Andreas Miethe) #
'# Thema           : Integer zu Römisch       #
'# XProfan-Version : 11                       #
'##############################################

Proc IntToRoman

    PARAMETERS Decimals&
    Declare Romans$[], Arabics$[], result$
    Var Romans$ = "I,IV,V,IX,X,XL,L,XC,C,CD,D,CM,M,MA,A,B"
    Var Arabics$ = "1,4,5,9,10,40,50,90,100,400,500,900,1000,4000,5000,10000"
    Romans$[] = Explode(Romans$, ",")
    Arabics$[] = Explode(Arabics$, ",")

    whileloop Len(Romans$,",")-1,0,-1

        While Decimals& >= Int(Arabics$[&loop])

            Decimals& = Decimals& - Int(Arabics$[&loop])
            Result$ = Result$ + Romans$[&loop]

        EndWhile

    EndWhile

    Return Result$

EndProc

CLS
Print IntToRoman(2013)
Print IntToRoman(4508)
Print IntToRoman(5108)
Print IntToRoman(10301)
WaitInput
End
 
XProfan X2
Win7 Professional, SP1, AMD FX(tm)-8350 Eight-Core Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
06/01/13  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

9.394 Views

Untitledvor 0 min.
p.specht11/20/21
Uwe Lang11/20/21
Manfred Barei11/19/21
Wilfried Friebe11/17/21
More...

Themeninformationen

this Topic has 2 subscriber:

Julian Schmidt (2x)
Andreas Miethe (2x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie