Italia
Fonte/ Codesnippets

Integer Roman Römische Ziffern - 2

 

Andreas
Miethe


Integer in römische Ziffern konvertieren.
KompilierenMarkierenSeparieren
'##############################################
'# 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 :  [...] 
01.06.2013  
 




Julian
Schmidt
Irre ich mich oder gibt es nicht auch das ↁ als 5000, oder manchmal auch A geschrieben.

Die spinnen, die Römer!
 
XProfan X2
Win7 Professional, SP1, AMD FX(tm)-8350 Eight-Core Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
01.06.2013  
 




Andreas
Miethe


Julian Schmidt (01.06.13)

Irre ich mich oder gibt es nicht auch das ? als 5000, oder manchmal auch A geschrieben.

Die spinnen, die Römer!


Schon richtig, und ↂ per 10000.
Du darfst das gerne erweitern
 
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 :  [...] 
01.06.2013  
 




Julian
Schmidt
Okay, so.
KompilierenMarkierenSeparieren
'##############################################
'# 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 [...] 
01.06.2013  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

Kein Systemprofil angelegt. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Bitte anmelden um einen Beitrag zu verfassen.
 

Topic-Options

9.397 Views

Untitledvor 0 min.
p.specht20.11.2021
Uwe Lang20.11.2021
Manfred Barei19.11.2021
Wilfried Friebe17.11.2021
Di più...

Themeninformationen

Dieses Thema hat 2 subscriber:

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


Admins  |  AGB  |  Applications  |  Autori  |  Chat  |  Informativa sulla privacy  |  Download  |  Entrance  |  Aiuto  |  Merchantportal  |  Impronta  |  Mart  |  Interfaces  |  SDK  |  Services  |  Giochi  |  Cerca  |  Support

Ein Projekt aller XProfaner, die es gibt!


Il mio XProfan
Private Notizie
Eigenes Ablageforum
Argomenti-Merkliste
Eigene Beiträge
Eigene Argomenti
Zwischenablage
Annullare
 Deutsch English Français Español Italia
Traduzioni

Informativa sulla privacy


Wir verwenden Cookies nur als Session-Cookies wegen der technischen Notwendigkeit und bei uns gibt es keine Cookies von Drittanbietern.

Wenn du hier auf unsere Webseite klickst oder navigierst, stimmst du unserer Erfassung von Informationen in unseren Cookies auf XProfan.Net zu.

Weitere Informationen zu unseren Cookies und dazu, wie du die Kontrolle darüber behältst, findest du in unserer nachfolgenden Datenschutzerklärung.


einverstandenDatenschutzerklärung
Ich möchte keinen Cookie