View Code of Problem 85

#include<stdio.h>
#include<string.h>
#include<math.h>
#include<malloc.h>

void judge(int a[100][100], int i, int j,int n, int m) {
	int x = a[i][j];
	for (int k = 0;k < m;k++) {
		if (a[i][k] < x)
			return 0;
	}
	for (int k = 0;k < n;k++) {
		if (a[j][k] > x)
			return 0;
	}
	return 1;
}

int main(){
	int n, m;
	scanf("%d%d", &n, &m);
	int a[n][m];
	for (int i = 0;i < n;i++)
		for (int j = 0;j < m;j++)
			scanf("%d", &a[i][j]);
	for (int i = 0;i < n;i++)
		for (int j = 0;j < m;j++) 
			if (judge(a, i, j, n, m))
				printf("%d %d\n", i + 1, j + 1);
		


}
/*
Main.c: In function 'judge':
Main.c:10:4: warning: 'return' with a value, in function returning void
    return 0;
    ^
Main.c:14:4: warning: 'return' with a value, in function returning void
    return 0;
    ^
Main.c:16:2: warning: 'return' with a value, in function returning void
  return 1;
  ^
Main.c: In function 'main':
Main.c:28:8: error: void value not ignored as it ought to be
    if (judge(a, i, j, n, m))
        ^
*/

Double click to view unformatted code.


Back to problem 85