View Code of Problem 17

#include<stdio.h>
int main()
{
	int m,n,i,j,temp;
	int a[100][100];
	while(scanf("%d%d",&n,&m)!=EOF)
	{
		for(i=0;i<n;i++)
		{
			for(j=0;j<m;j++)
			{
				scanf("%d",&a[i][j]);
			}
		}
		temp=0;
		for(i=0;i<n;i++)
		{
			for(j=0;j<m;j++)
			{
				if(temp<a[i][j])
				temp=a[i][j];
			 } 
		 } 
		 printf("%d\n",temp-1);
	}
	return 0;
 } 

Double click to view unformatted code.


Back to problem 17