c语言编程,大一的题目
答案:1 悬赏:50 手机版
解决时间 2021-03-27 01:28
- 提问者网友:那叫心脏的地方装的都是你
- 2021-03-26 03:37
c语言编程,大一的题目
最佳答案
- 五星知识达人网友:春色三分
- 2021-03-26 05:02
#include
#define N 4
int main(void)
{
int a[N][N];
int he=0,ji=1,mx,px=0,py=0,i,j;
printf("Please input array(%d * %d:
",N,N);
for(i=0;i for (j=0;j {
scanf("%d",&a[i][j]);
}
mx=a[0][0];
for (i=0;i {
for (j=0;j {
if (i==j||(i+j+1)==N)//对角线
{
he += a[i][j];
if(i%2==0 && j%2==0)
ji *= a[i][j];
if(mx<=a[i][j])
{
mx = a[i][j];
px = i;
py = j;
}
}
}
}
printf("he is %d
",he);
printf("ji is %d
",ji);
printf("mx is %d (array[%d][%d])
",mx,px,py);
return 0;
}
#define N 4
int main(void)
{
int a[N][N];
int he=0,ji=1,mx,px=0,py=0,i,j;
printf("Please input array(%d * %d:
",N,N);
for(i=0;i
scanf("%d",&a[i][j]);
}
mx=a[0][0];
for (i=0;i
for (j=0;j
if (i==j||(i+j+1)==N)//对角线
{
he += a[i][j];
if(i%2==0 && j%2==0)
ji *= a[i][j];
if(mx<=a[i][j])
{
mx = a[i][j];
px = i;
py = j;
}
}
}
}
printf("he is %d
",he);
printf("ji is %d
",ji);
printf("mx is %d (array[%d][%d])
",mx,px,py);
return 0;
}
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯