#include <stdio.h>
int main(int argc, const char * argv[]) { int score[5][3]={ {80,75,92}, {61,65,71}, {59,63,70}, {85,87,90}, {76,77,85} }; int max,maxrow=-1,maxcol=-1; //假设max一个最大值 max=score[0][0]; for (int i=0; i<5; i++) { for (int j=0; j<3; j++) { if (max<score[j]) { max=score[j]; maxrow=i; maxcol=j; } } } printf("最大值是%d在%d行,%d列",max,maxrow,maxcol);
return 0; }
|