int length = 0;
printf("输入一个数组长度:");
scanf("%d", &length);
int *p = malloc(sizeof(int) * length);
for (int i = 0; i < length; i++) {
*(p + i) = arc4random() % 21 + 20;
printf("%d ", *(p + i));
}
int max = 0;
for (int i = 0; i < length; i++) {
if (max < *(p + i)) {
max = *(p + i);
}
}
printf("\n%d", max);
free(p);
p = NULL;