/*二維數組求最小值*/ #include<stdio.h> #include<stdlib.h> int main() { int ch1[3][4]= {888,2,4,6,7,5,8,99,77,44,87,77}; int i,j,min,list=0,hang=0; min=ch1[0][0];//假設該座標爲最小值// for(i=0; i<3; i++) for(j=0; j<4; j++) { if(ch1[i][j]<min) { min=ch1[i][j]; hang=i; list=j; } } printf("min=%d hang=%d list=%d\n",min,hang,list);//輸出最小值及座標點// system("pause"); return 0; }