Si fa con lo shuffle
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
#define SIZE 50
int main(){
int i, j, k, a[SIZE];
for(i = 0; i < SIZE; i++)
a[i] = i + 1;
srand(time(NULL));
for(i = 0; i < SIZE; i++) {
j = rand() % (SIZE - i) + i;
k = a[j];
a[j] = a[i];
a[i] = k;
}
for(i = 0; i < SIZE; i++)
cout << a[i] << " ";
return 0;
}