responder urgente por fa

TEO
15 de Junio del 2006
como puedo hacer un programa en bisual basic que al ingresar un numero entero me de como resultado en romanos...

acemel
15 de Junio del 2006
Option Explicit
Dim Numero As Integer
Dim Romanos As String
Dim Resto As String
Dim n, i As Integer
Dim Caracter, CaracterS As String


Private Sub Command1_Click()
Romanos = ""
Numero = Text1.Text

n = Numero 1000
Numero = Numero - 1000 * n
Caracter = "M"
If n > 3 Then
Romanos = Romanos + "("
Romanos = Romanos + Trim(Str(n))
Romanos = Romanos + ")M"
ElseIf n <> 0 Then Call AƱadirRomano
End If

n = Numero 500
Numero = Numero - 500 * n
Caracter = "D"
If n <> 0 Then Call AƱadirRomano

n = Numero 100
Numero = Numero - 100 * n
Caracter = "C"
CaracterS = "D"
If n <> 0 Then Call AƱadirRomano

n = Numero 50
Numero = Numero - 50 * n
Caracter = "L"
If n <> 0 Then Call AƱadirRomano

n = Numero 10
Numero = Numero - 10 * n
Caracter = "X"
CaracterS = "L"
If n <> 0 Then Call AƱadirRomano

Resto = Numero Mod 5
n = Numero 5
Caracter = "V"
If n <> 0 Then Call AƱadirRomano
n = Resto
Caracter = "I"
CaracterS = "V"
If n <> 0 Then Call AƱadirRomano

Text2.Text = Romanos
End Sub

Private Sub AƱadirRomano()
If n = 4 Then
Romanos = Romanos + Caracter
Romanos = Romanos + CaracterS
Else
For i = 1 To n
Romanos = Romanos + Caracter
Next
End If
End Sub