luofuxiang
#include <iostream>
#define X 4
#define Y 4
using namespace std;
void f(int arr[X][Y],int x,int y)
{
int i,j;
i = x, j = y;
while(--i>=0 && --j>=0) cout << arr[i][j] << " ";//左上
i = x, j = y;
while(--i>=0 && ++j<Y) cout << arr[i][j] << " ";//右上
i = x, j = y;
while(++i<X && --j>=0) cout << arr[i][j] << " ";//左下
i = x, j = y;
while(++i<X && ++j<Y) cout << arr[i][j] << " ";//右上
}
int main()
{
int arr[X][Y]= {{11,12,13,14},
{21,22,23,24},
{31,32,33,34},
{41,42,43,44}};
f(arr,1,2);//<--表示第2行第3列(注意从0开始编号)
//对角线坐标(不含本省)应该为12,14,32,41,34
return 0;
}