#include <stdio.h> #include <stdlib.h> /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main() { int i,j,m,n; int min=0,max=0; scanf("%d%d",&m,&n); int a[m][n]; for(i=0;i<n;i++){ for(j=0;j<n;j++){ scanf("%d",&a[i][j]); } } for(i=0;i<m;i++){ for(j=0;j<n;j++){ if(a[i][j]<a[i][min]){ min=j; } if(a[i][j]>a[max][j]){ max=i; } } } printf("%d %d",max+1,min+1); } |
Double click to view unformatted code.