代码文本:
#include "stdio.h"
#include <stdlib.h>
#include "time.h"
int main(int argc,char *argv[]){
int m,t,i,j,k,*p;
if((p=(int *)malloc(sizeof(int)*(k=1000-100)))!=NULL){
srand((unsigned)time(NULL));
for(i=0;i<k;p[i++]=100+i);
for(k--,i=0;i<10;i++){
for(j=0;j<10;j++){
printf("%4d",p[m=rand()%k]);
t=p[m],p[m]=p[k],p[k--]=t;
}
putchar('\n');
}
free(p);
}
else
printf("Application memory failure, exit...\n");
return 0;
}