View Code of Problem 85

#include<stdio.h>

int main()
{
	int m, n;
	int x, y;
	int a[100][100]={0};
	scanf("%d%d", &m, &n);
	for(int i = 1; i <= m; i++)
		for(int j = 1; j <= n; j++)
			scanf("%d", &a[i][j]);
	for(int i = 1; i <= m; i++)
	{
		y = 1;
		for(int j = 2; j <= n; j++)
			if(a[i][y] > a[i][j] )
				y = j;
		x = i;
		for(int k = 1; k <= m; k++)
			if(a[x][y] < a[k][y] )
				x = k;
		if(x == i)
			printf("%d %d", x, y);
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 85