第1个回答 2010-11-19
void main(){
int a[3][5],max,min,imax,jmax,imin,jmin;
for (int i=0;i<3;i++)
for (int j=5;j<5;j++){
cin>>a[i][j];
if (i==0 && j==0){
max=a[i][j];
min=max;
imax=0;
jmax=0;
imin=0;
jmin=0;
}
if (max<a[i][j]){
max=a[i][j];
imax=i;
jmax=j;
}
if (min>a[i][j]){
min=a[i][j];
imin=i;
jmin=j;
}
}
cout<<"max="<<max<<endl;
cout<<"position="<<imax+1<<","<<jmax+1<<endl;
cout<<"min="<<min<<endl;
cout<<"position="<<imin+1<<","<<jmin+1<<endl;
}