|
Mostrar Mensajes
|
Páginas: 1 2 [3] 4 5 6 7 8
|
24
|
Programación / Ejercicios / Ejercicio Conversión
|
en: 19 Mayo 2009, 04:12 am
|
Hola miren este problema: Convertir un número entero de base 2 a base 4 por el método directo.El método directo consiste en por ejemplo Entrada: 1101001100 Separa el dígito de a dos, en este caso por ser la base de llegada igual a 4. En consecuencia: 11-01-00-11-00 Por conversión quedaría: 31030 Espero que eso no haya causado problemas. Ahora este es el siguiente algoritmo que me gustaría que chekaran aver si existe una forma más fácil y como poder optimizarlo. ; ; ; ; ; ; "0"; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; "0"; ;
|
|
|
25
|
Programación / Ejercicios / Re: Ejercicios Básicos
|
en: 19 Mayo 2009, 01:37 am
|
Aqui un nuevo reto, espero que lo resuelvan rápido aplicando el mejor método. Mostrar los k primeros numeros naturales que verifiquen la condicion de poseer una cantidad impar de divisoresSuerte!
|
|
|
29
|
Programación / .NET (C#, VB.NET, ASP) / Re: Ayudas o sugerencias - programa signo zodiaco
|
en: 18 Mayo 2009, 01:49 am
|
Ahora arreglado el tema de la entrada con mayuscula o minuscula... Usando Ucase() Solo falta depurar un poco más los signos, pero creo que ya esta bien. Dim dia As String Dim mes As String Dim reponse As Boolean Private Sub Form_Load() dia = InputBox("Ingrese dia", "Signos") If dia = "" Then End End If While (dia < 1) Or (dia > 31) Or (dia = "") MsgBox "Error, los meses solo contienen dias entre 1 y 31", vbOKOnly dia = InputBox("Ingrese dia", "Signos") Wend dia = Val(dia) mes = InputBox("Ingrese mes", "Signos") mes = UCase(mes) Select Case mes Case "ENERO" If dia < 21 Then MsgBox "CAPRICORNIO", vbOKOnly Else: MsgBox "ACUARIO", vbOKOnly End If Case "FEBRERO" If dia < 20 Then MsgBox "ACUARIO", vbOKOnly Else: MsgBox "PISCIS", vbOKOnly End If Case "MARZO" If dia < 21 Then MsgBox "PISCIS", vbOKOnly Else: MsgBox "ARIES", vbOKOnly End If Case "ABRIL" If dia < 21 Then MsgBox "ARIES", vbOKOnly Else: MsgBox "TAURO", vbOKOnly End If Case "MAYO" If dia < 21 Then MsgBox "TAURO", vbOKOnly Else: MsgBox "GEMINIS", vbOKOnly End If Case "JUNIO" If dia < 21 Then MsgBox "GEMINIS", vbOKOnly Else: MsgBox "CANCER", vbOKOnly End If Case "JULIO" If dia < 24 Then MsgBox "CANCER", vbOKOnly Else: MsgBox "LEO", vbOKOnly End If Case "AGOSTO" If dia < 24 Then MsgBox "LEO", vbOKOnly Else: MsgBox "VIRGO", vbOKOnly End If Case "SETIEMBRE" If dia < 24 Then MsgBox "VIRGO", vbOKOnly Else: MsgBox "LIBRA", vbOKOnly End If Case "OCTUBRE" If dia < 24 Then MsgBox "LIBRA", vbOKOnly Else: MsgBox "ESCORPIO", vbOKOnly End If Case "NOVIEMBRE" If dia < 22 Then MsgBox "ESCORPIO", vbOKOnly Else: MsgBox "SAGITARIO", vbOKOnly End If Case "DICIEMBRE" If dia < 22 Then MsgBox "SAGITARIO", vbOKOnly Else: MsgBox "CAPRICORNIO", vbOKOnly End If Case Else MsgBox "Error", vbOKOnly End Select End End Sub
|
|
|
30
|
Programación / .NET (C#, VB.NET, ASP) / Re: Ayudas o sugerencias - programa signo zodiaco
|
en: 18 Mayo 2009, 01:08 am
|
Dim dia As String Dim mes As String Dim reponse As Boolean Private Sub Form_Load() dia = InputBox("Ingrese dia", "Signos") If dia = "" Then End End If While (dia < 1) Or (dia > 31) Or (dia = "") MsgBox "Error, los meses solo contienen dias entre 1 y 31", vbOKOnly dia = InputBox("Ingrese dia", "Signos") Wend dia = Val(dia) mes = InputBox("Ingrese mes", "Signos") Select Case mes Case "enero" If dia < 21 Then MsgBox "CAPRICORNIO", vbOKOnly Else: MsgBox "ACUARIO", vbOKOnly End If Case "febrero" If dia < 20 Then MsgBox "ACUARIO", vbOKOnly Else: MsgBox "PISCIS", vbOKOnly End If Case "marzo" If dia < 21 Then MsgBox "PISCIS", vbOKOnly Else: MsgBox "ARIES", vbOKOnly End If Case "abril" If dia < 21 Then MsgBox "ARIES", vbOKOnly Else: MsgBox "TAURO", vbOKOnly End If Case "mayo" If dia < 21 Then MsgBox "TAURO", vbOKOnly Else: MsgBox "GEMINIS", vbOKOnly End If Case "junio" If dia < 22 Then MsgBox "GEMINIS", vbOKOnly Else: MsgBox "CANCER", vbOKOnly End If Case "julio" If dia < 23 Then MsgBox "CANCER", vbOKOnly Else: MsgBox "LEO", vbOKOnly End If Case "agosto" If dia < 23 Then MsgBox "LEO", vbOKOnly Else: MsgBox "VIRGO", vbOKOnly End If Case "setiembre" If dia < 23 Then MsgBox "VIRGO", vbOKOnly Else: MsgBox "LIBRA", vbOKOnly End If Case "octubre" If dia < 23 Then MsgBox "LIBRA", vbOKOnly Else: MsgBox "ESCORPIO", vbOKOnly End If Case "noviembre" If dia < 22 Then MsgBox "ESCORPIO", vbOKOnly Else: MsgBox "SAGITARIO", vbOKOnly End If Case "diciembre" If dia < 22 Then MsgBox "SAGITARIO", vbOKOnly Else: MsgBox "CAPRICORNIO", vbOKOnly End If Case Else MsgBox "Error", vbOKOnly End Select End Sub
|
|
|
|
|
|
|