int count = 0;//定义数组长度
printf("请输入数组长度:");
scanf("%d",&count);
int *p = malloc(sizeof(int)*count);
for (int i = 0; i<count; i++) {
*(p+i) = arc4random()%(count-1+1)+1;
printf("%d ",*(p+i));
} printf("\n");
int max = 0;
for (int i = 0; i<count; i++) {
if (max<*(p+i)) {
max = *(p+i);
}
}
printf(" max = %d ",max);
原文地址:http://9178487.blog.51cto.com/9168487/1532450