View Code of Problem 85

#include <stdio.h>
main(){
	int n,m,i,j,h,l;
	scanf("%d%d",&n,&m);
	int a[n][m];
	for(i = 0;i<n;i++){
		for(j =0;j<m;j++)
			scanf("%d",&a[i][j]);
	}
	for(i = 0;i<n;i++){
		int min = a[i][0],l = 0;
		int I,max,h = 0;
		for(j = 0; j<m;j++){
			if(min > a[i][j])
				l = j;
		}		
		max = a[0][l];
		for(I = 0; I<n;I++){
			if(max < a[I][j])
				h = I;
		}
		if(h == i)
			printf("%d %d",h+1,l+1);
	}
	return 0;
} 

Double click to view unformatted code.


Back to problem 85