哪里错了? 5
#include<stdio.h>#defineN3main(){inta[N][N],i,j,b,c;intdiagsum1(inta[N][N]);intdiagsu...
#include<stdio.h>
#define N 3
main()
{
int a[N][N], i, j, b, c;
int diagsum1(int a[N][N]);
int diagsum2(int a[N][N]);
for (i = 0; i<N; i++)
{
printf("请输入第%d行数字\n", i);
for (j = 0; j<N; j++)
scanf("%d", &a[i][j]);
}
b = diagsum1(a);
c = diagsum2(a);
printf("主对角线和为:%d\n", b);
printf("斜对角线和为:%d\n", c);
} 展开
#define N 3
main()
{
int a[N][N], i, j, b, c;
int diagsum1(int a[N][N]);
int diagsum2(int a[N][N]);
for (i = 0; i<N; i++)
{
printf("请输入第%d行数字\n", i);
for (j = 0; j<N; j++)
scanf("%d", &a[i][j]);
}
b = diagsum1(a);
c = diagsum2(a);
printf("主对角线和为:%d\n", b);
printf("斜对角线和为:%d\n", c);
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询