View Code of Problem 17

#include<stdio.h>
#include<stdlib.h>
void main(){
	int n,m;
	int i,j;
	//int left,right,top,bottom;
	int center,middle;
	int count;
	while(~scanf("%d%d",&n,&m)){
		
		int array[n][m];
		for(i = 0; i < n; i ++){
			for(j = 0; j < m; j ++){
				scanf("%d",&array[i][j]);
			}
		}
		center = n / 2;
		middle = m / 2;
		count = array[center][middle] - 1;
		printf("%d",count);
		
	}
	
}

Double click to view unformatted code.


Back to problem 17