#include<iostream.h> 
 const int N=4;
 int main()                                                  
{
 int sta(int (*p)[N]); 
 int a[N][N],i,j,sum;
 cout<<"请输入数组元素的值："<<endl;
 for(i=0;i<N;i++)
  for(j=0;j<N;j++)
   cin>>a[i][j];
 sum=sta(a);
 cout<<"sum="<<sum<<endl;
 return(0);
}
 int sta(int (*p)[N]) 
{
 int sum,i,j;
 for(i=0,sum=0;i<N;i++)
  for(j=0;j<N;j++)
   if((i+j)%2==0)
    sum+=*(*(p+i)+j);
 return(sum);
}
