| |
|
|
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 X2Gruss 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! |
|
|
| |
|
|
|
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 X2Gruss 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
|
|
|
| |
|
|