# include <stdio.h> # define N 20 main(){ int a, b; int array[N]={1,2,3,4,7,45,45,23,4,1,0,432,42,55,24,64,46}; //array中输入需要排序的数字 int max = array[0]; for(a = 1; a < N; a++){ if(array[a]>max){ max = array[a]; //使用max函数,快速筛选出最大值 } } printf("Max = %d\n",max,b); }
时间: 2024-10-09 09:09:57