View Code of Problem 85

#include<stdio.h>
#include <string.h>
#include <math.h>
int main(){
	int m,n;
	int a[100][100];
	int i,j;
	scanf("%d %d",&m,&n);
	int t=0,k=0,h;
	for(i=0;i<m;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][t])
			t=j;
		}
		for(k=0;k<m;k++){
			if(a[k][t]>a[i][t]){
				h=k;
			}
		}
		if(h==i){
			printf("%d %d",i+1,t+1);
		}
		else{
			continue;
		}	
	}
	
	printf("\n");
	return 0;
}

Double click to view unformatted code.


Back to problem 85