View Code of Problem 17

#include<bits/stdc++.h>
using namespace std;
#define N 500
int main()
{
	int a[N][N];
	int m,n,i,j,max;
	cin>>m>>n;
	max=INT_MIN;
	for(i=0;i<m;i++)
		for(j=0;j<n;j++)
		{
			cin>>a[i][j];
			max=max>a[i][j]?max:a[i][j];
		}
	cout<<max-1<<endl;
	return 0;
}

Double click to view unformatted code.


Back to problem 17