#include<stdio.h>
#define N 5
int fun(int (*p)[N],int m)
{
int sum=0,i,j;
for(i=0;i<m;i++)
{
if(i0||i(m-1))
{
for(j=0;j<N;j++)
sum=sum+p[i][j];
}
else
sum=sum+p[i][0]+p[i][N-1];
}
return sum;
}
int main()
{int a[4][N]={{3,2,5,4,2},{6,2,3,9,1},{4,6,1,8,6},{7,6,5,4,2}};
printf(“sum=%d\n”,fun(a,4));
return 0;
}
third
最新推荐文章于 2022-09-01 21:24:47 发布