#include#include #include void swap(int *a, int *b) { int temp = *a; *a = *b; *b = temp; } int myrand(int left, int right) { return (left+rand()%(right - left +1)); } void xipai(int *A,int len) { for(int i=0;i ) { swap(&A[i],&A[myrand(i,len-1)]); } } void print(int *A,int len) { for(int i=0;i 1;i++) { printf("%d ",A[i]); } printf("%d\n",A[len-1]); } int main() { int A[]={1,2,3,4,5,6,7,8,9,10,11,12,13}; srand((unsigned int)time(NULL)); int len = sizeof(A)/sizeof(int); xipai(A,len); print(A,len); }