明月笑刀无情
程序如下,如果觉得好,请采纳:#include <stdio.h>#include <stdlib.h>#define NUM 20int Get_Min_Value(int *array, int num){int ii, value = *array;for(ii=0;ii<num-1;ii++){array ++;if( (*array) < value ){value = *array;}}return value;}int Get_Max_Value(int *array, int num){int ii, value = *array;for(ii=0;ii<num-1;ii++){array ++;if( (*array) > value ){value = *array;}}return value;}int main(void){int ii, MyArray[NUM];clrscr();srand((int)time(0));printf("Random array is:\n");for(ii=0;ii<NUM;ii++){MyArray[ii] = rand();printf("%d",MyArray[ii]);if(ii != NUM-1) printf(", ");}printf("\n");printf("\nThe Maximum value is: %d", Get_Max_Value(MyArray, NUM));printf("\nThe Minimum value is: %d", Get_Min_Value(MyArray, NUM));getchar();return 0;}