Propuesta de solución en Python: py_pdf, también incluye versión en matlab: m_pdf
# ICM00794-Fundamentos de Computación - FCNM-ESPOL # Mejoramiento I Término 2005 # Tema 4. Pozo millonario # Propuesta de solucion: edelros@espol.edu.ec import numpy import random n=int(input('seleccionar:')) m=int(input('de cuantos:' )) # Ninguno seleccionado tabla=numpy.zeros(m+1,dtype=int) k=1 while not(k>m): tabla[k]=0 k=k+1 i=1 while not(i>n): sorteado=int(random.random()*m)+1 if (tabla[sorteado]==0): tabla[sorteado]=1 i=i+1 #Salida k=1 print('Los numeros de la tabla son:') while not(k>m): if (tabla[k]==1): print(k) k=k+1