lundi 4 décembre 2017

I want to check every matrix elements to give them different number

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.

It has to look like this




Aucun commentaire:

Enregistrer un commentaire