#include <stdio.h>
#define M 5
#define N 5
main()
{
int i,j,s=0;
int a[M][N]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25};
for(i=0;i<M;i++)
{
for(j=0;j<N;j++)
{
printf(" %2d",a[i][j]);
}
printf("\n");
}
for(i=0;i<M;i++)
{
for(j=0;j<N;j++)
{
if((ij)||(i+j4))
s+=a[i][j];
}
}
printf("%d",s);
}
函数编写: