Guest User

Untitled

a guest
Feb 24th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #include<iostream>
  2. #include<cstdlib>
  3. #include<ctime>
  4. #include<algorithm>
  5.  
  6. using namespace std;
  7.  
  8. int const MAX=10;
  9.  
  10. typedef int tArray[MAX];
  11.  
  12. int random (int i) { return rand()%i;}
  13.  
  14. int main()
  15. {
  16. srand(time(NULL));
  17. tArray miarray;
  18. for(int i=0; i<MAX; i++)
  19. {
  20. miarray[i]=i;
  21. }
  22.  
  23. random_shuffle(miarray.begin(),miarray.end());
  24. random_shuffle(miarray.begin(),miarray.end(),random);
  25.  
  26. cout << "La secuencia aleatoria es:";
  27.  
  28. for()//mostrar los datos barajados
  29. {
  30. cout << endl;
  31. }
  32. }
Add Comment
Please, Sign In to add comment