I want to create 10x10 matrix.
- Function(1)I will give random number between 1-100 by using srand().I have done that.
- Function(2) I want to use rand() function until it gives different number from other elements.
This is the problem I can't create Function(2). First I want to check whether it has repeated elements and then give number with Rand() until it gives different number from other matrix elements. I use rand() Because I have to count how many times I used rand().I have used many ways to do that but I couldn't manage.
Aucun commentaire:
Enregistrer un commentaire