| 
	
		|  Autor | Tema: Como puedo saber los números que faltan dentro del rango ?   (Leído 16,033 veces) |  
	| 
			| 
					
						| luis456 
								 
								
								 Desconectado 
								Mensajes: 551
								
								   | 
 
Bien todavia super atascado
 No habria una forma de comparar los resultados del array que contiene los resultados
 con los numeros del 00 al 99 y que diga cuales faltan ?
 
 Joe pense que esto era facil jejej.
 
 Luis
 
 
 |  
						| 
								|  |  
								|  |  En línea | 
 
 Que tu sabiduria no sea motivo de Humillacion para los demas |  |  |  | 
			| 
					
						| Legnak 
								
								 Desconectado 
								Mensajes: 61
								
								 
								("Programador");
								
								
								
								
								
								   | 
 
Bien todavia super atascado
 No habria una forma de comparar los resultados del array que contiene los resultados
 con los numeros del 00 al 99 y que diga cuales faltan ?
 
 Joe pense que esto era facil jejej.
 
 Luis
 
 en la respuesta que puse te deje un algoritmo sencillo de como hacer eso, y funciona  
 
 |  
						| 
								|  |  
								|  |  En línea | 
 
 |  |  |  | 
			| 
					
						| luis456 
								 
								
								 Desconectado 
								Mensajes: 551
								
								   | 
 
en la respuesta que puse te deje un algoritmo sencillo de como hacer eso, y funciona 
 Como ya comente en esto soy novato lo mio era el viejo foxpro jejej pongo el codigo pero me error Public Class Form1     Dim Max As Integer = 99    Dim Xmin As Integer = 0    Dim x As Integer = 0    Dim Número As Double     Private TextBoxes As TextBox() = {Nothing}    Private Result1 As Int32(), Result2 As Int32(), Result3 As Int32()    Private _textBox As Object    Private _getNumbersNotInRange As Object     Private Property ListBox1Count As Integer     Private Property Calcular As Object     Private Property TextBox(ByVal TextBoxCount As Short) As Object        Get            Return _textBox        End Get        Set(ByVal value As Object)            _textBox = value        End Set    End Property      ReadOnly Property Num1 As Int32        Get            Return CInt(TextBox1.Text)        End Get    End Property     ReadOnly Property Num2 As Int32        Get            Return CInt(TextBox2.Text)        End Get    End Property    ReadOnly Property Num3 As Int32        Get            Return CInt(TextBox3.Text)        End Get    End Property     Private Property GetNumbersNotInRange(ByVal Result11 As IEnumerable(Of Integer), ByVal Xmin As Integer, ByVal XMax As Integer) As Object        Get            Return _getNumbersNotInRange        End Get        Set(ByVal value As Object)            _getNumbersNotInRange = value        End Set    End Property      Private Sub Sumar(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click           Result1 = {Num1 + 10, Num1 + 20, Num1 + 30} _                  .Distinct().ToArray ' Elimino duplicados         Result2 = {Num2 + 10, Num2 + 20, Num2 + 30} _                  .Distinct().ToArray ' Elimino duplicados         Result3 = {Num3 + 10, Num3 + 20, Num3 + 30} _                  .Distinct().ToArray ' Elimino duplicados        ' primero concatenas y eliminas duplicados en el primer array:         Dim Result11 As IEnumerable(Of Integer) =        (Result1.Concat(Result2).Concat(Result3).          Distinct)          ' Dim arregloSumas() As Integer = {10, 15, 20, 25, 30}        Dim numerosFaltantesdelRango() As Integer = {}        Dim rango_min As Integer = 0, rango_max As Integer = 99        Dim tamanio As Integer        Dim val As Integer         For i = rango_min To rango_max            val = i            If Array.Exists(Result11, Function(value As Integer) value = val) = False Then 'Compruebo si el valor de i no aparece en el arreglo de las sumas                tamanio = numerosFaltantesdelRango.Length + 1                ReDim numerosFaltantesdelRango(tamanio)                numerosFaltantesdelRango(tamanio) = val 'Agrego el valor al arreglo            End If        Next        ListBox1.Items.AddRange(numerosFaltantesdelRango.Cast(Of Object).ToArray)    End SubEnd Class 
 |  
						| 
								|  |  
								| « Última modificación: 27 Enero 2014, 16:47 pm por Eleкtro » |  En línea | 
 
 Que tu sabiduria no sea motivo de Humillacion para los demas |  |  |  | 
			| 
					
						| Legnak 
								
								 Desconectado 
								Mensajes: 61
								
								 
								("Programador");
								
								
								
								
								
								   | 
 
ahora si funciona    Public Class Form1     Dim Max As Integer = 99    Dim Xmin As Integer = 0    Dim x As Integer = 0    Dim Número As Double     Private TextBoxes As TextBox() = {Nothing}    Private Result1 As Int32(), Result2 As Int32(), Result3 As Int32()    Private _textBox As Object    Private _getNumbersNotInRange As Object     Private Property ListBox1Count As Integer     Private Property Calcular As Object     Private Property TextBox(ByVal TextBoxCount As Short) As Object        Get            Return _textBox        End Get        Set(ByVal value As Object)            _textBox = value        End Set    End Property      ReadOnly Property Num1 As Int32        Get            Return CInt(TextBox1.Text)        End Get    End Property     ReadOnly Property Num2 As Int32        Get            Return CInt(TextBox2.Text)        End Get    End Property    ReadOnly Property Num3 As Int32        Get            Return CInt(TextBox3.Text)        End Get    End Property     Private Property GetNumbersNotInRange(ByVal Result11 As IEnumerable(Of Integer), ByVal Xmin As Integer, ByVal XMax As Integer) As Object        Get            Return _getNumbersNotInRange        End Get        Set(ByVal value As Object)            _getNumbersNotInRange = value        End Set    End Property      Private Sub Sumar(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click           Result1 = {Num1 + 10, Num1 + 20, Num1 + 30} _                  .Distinct().ToArray ' Elimino duplicados         Result2 = {Num2 + 10, Num2 + 20, Num2 + 30} _                  .Distinct().ToArray ' Elimino duplicados         Result3 = {Num3 + 10, Num3 + 20, Num3 + 30} _                  .Distinct().ToArray ' Elimino duplicados        ' primero concatenas y eliminas duplicados en el primer array:         Dim Result11 As IEnumerable(Of Integer) =        (Result1.Concat(Result2).Concat(Result3).          Distinct)          ' Dim arregloSumas() As Integer = {10, 15, 20, 25, 30}        Dim numerosFaltantesdelRango() As Integer = {}        Dim rango_min As Integer = 0, rango_max As Integer = 99        Dim tamanio As Integer        Dim val As Integer          Dim test As Integer        For i = rango_min To rango_max            val = i            If Array.Exists(Result11.Cast(Of Object).ToArray, Function(value As Integer) value = val) = False Then 'Compruebo si el valor de i no aparece en el arreglo de las sumas                 test += 1                tamanio = UBound(numerosFaltantesdelRango) + 1                ReDim Preserve numerosFaltantesdelRango(tamanio)                numerosFaltantesdelRango(tamanio) = val 'Agrego el valor al arreglo             End If        Next         ListBox1.Items.AddRange(numerosFaltantesdelRango.Cast(Of Object).ToArray)     End SubEnd Class
 |  
						| 
								|  |  
								|  |  En línea | 
 
 |  |  |  | 
			| 
					
						| luis456 
								 
								
								 Desconectado 
								Mensajes: 551
								
								   | 
 
ahora si funciona    Public Class Form1     Dim Max As Integer = 99    Dim Xmin As Integer = 0    Dim x As Integer = 0    Dim Número As Double     Private TextBoxes As TextBox() = {Nothing}    Private Result1 As Int32(), Result2 As Int32(), Result3 As Int32()    Private _textBox As Object    Private _getNumbersNotInRange As Object     Private Property ListBox1Count As Integer     Private Property Calcular As Object     Private Property TextBox(ByVal TextBoxCount As Short) As Object        Get            Return _textBox        End Get        Set(ByVal value As Object)            _textBox = value        End Set    End Property      ReadOnly Property Num1 As Int32        Get            Return CInt(TextBox1.Text)        End Get    End Property     ReadOnly Property Num2 As Int32        Get            Return CInt(TextBox2.Text)        End Get    End Property    ReadOnly Property Num3 As Int32        Get            Return CInt(TextBox3.Text)        End Get    End Property     Private Property GetNumbersNotInRange(ByVal Result11 As IEnumerable(Of Integer), ByVal Xmin As Integer, ByVal XMax As Integer) As Object        Get            Return _getNumbersNotInRange        End Get        Set(ByVal value As Object)            _getNumbersNotInRange = value        End Set    End Property      Private Sub Sumar(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click           Result1 = {Num1 + 10, Num1 + 20, Num1 + 30} _                  .Distinct().ToArray ' Elimino duplicados         Result2 = {Num2 + 10, Num2 + 20, Num2 + 30} _                  .Distinct().ToArray ' Elimino duplicados         Result3 = {Num3 + 10, Num3 + 20, Num3 + 30} _                  .Distinct().ToArray ' Elimino duplicados        ' primero concatenas y eliminas duplicados en el primer array:         Dim Result11 As IEnumerable(Of Integer) =        (Result1.Concat(Result2).Concat(Result3).          Distinct)          ' Dim arregloSumas() As Integer = {10, 15, 20, 25, 30}        Dim numerosFaltantesdelRango() As Integer = {}        Dim rango_min As Integer = 0, rango_max As Integer = 99        Dim tamanio As Integer        Dim val As Integer          Dim test As Integer        For i = rango_min To rango_max            val = i            If Array.Exists(Result11.Cast(Of Object).ToArray, Function(value As Integer) value = val) = False Then 'Compruebo si el valor de i no aparece en el arreglo de las sumas                 test += 1                tamanio = UBound(numerosFaltantesdelRango) + 1                ReDim Preserve numerosFaltantesdelRango(tamanio)                numerosFaltantesdelRango(tamanio) = val 'Agrego el valor al arreglo             End If        Next         ListBox1.Items.AddRange(numerosFaltantesdelRango.Cast(Of Object).ToArray)     End SubEnd Class
Perfecto perfecto         Funciona como quería ¡ muchas gracias por tu ayuda Luis |  
						| 
								|  |  
								|  |  En línea | 
 
 Que tu sabiduria no sea motivo de Humillacion para los demas |  |  |  |  |  
 
	
 
 
				
					
						| Mensajes similares |  
						|  | Asunto | Iniciado por | Respuestas | Vistas | Último mensaje |  
						|   |   | como hacer un programa que imprima los numeros que no estan dentro de una rango Programación C/C++
 | pefo | 6 | 6,200 |  21 Noviembre 2012, 20:49 pm por rir3760
 |  
						|   |   | Como limitar rango de numeros en un texbox
							« 1 2 » Programación Visual Basic
 | luis456 | 14 | 7,978 |  23 Septiembre 2013, 16:01 pm por luis456
 |  
						|   |   | ¿Cómo puedo saber si alguién me espían dentro de mi red wifi? Seguridad
 | zythun | 1 | 6,675 |  1 Junio 2016, 04:41 am por engel lex
 |  
						|   |   | [PYTHON]¿Cómo guardar datos de un rango de números que genero con un While? Python
 | 4T1L4 | 2 | 4,097 |  24 Octubre 2016, 15:23 pm por 4T1L4
 |  
						|   |   | [BATCH][Aporte] Range.bat (generador de numeros aleatorio dentro de un rango) Scripting
 | CodeRed | 1 | 4,688 |  23 Mayo 2020, 20:44 pm por .:Xx4NG3LxX:.
 |    |