paulucho Posted February 21, 2014 at 06:08 PM Report #546074 Posted February 21, 2014 at 06:08 PM Olá pessoal encontro com dificuldade para verificar se o numero gerado já existe e gerar outro
vikcch Posted February 21, 2014 at 08:02 PM Report #546085 Posted February 21, 2014 at 08:02 PM guarda os numeros gerados numa lista e sempre que geras outro verifcas de já existe na lista... se forem poucos numeros esta solução chega... outra maneira era teres uma lista com x numeros, e sempre que gerares um numero removes esse indice, geras sempre um numero até ao numero de elementos dessa lista, assim nunca sai repetidos...
Retsu9 Posted February 23, 2014 at 10:14 AM Report #546330 Posted February 23, 2014 at 10:14 AM aconselhava secalhar um array e um ciclo do...while ou algo do genero
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now