#include<stdio.h>
main()
{
int a[5][5],i,j,s1=0,s2=0,max,min;
for(i=0;i<5;++i)
for(j=0;j<5;++j)
scanf("%d",&a[i][j]);
max=min=a[0][0];
printf("矩阵为:\n");
for(i=0;i<5;++i)
{
for(j=0;j<5;++j)
{
printf("%4d",a[i][j]);
if(max<a[i][j])max=a[i][j];
if(min>a[i][j])min=a[i][j];
if(i==j)s1+=a[i][j];
if(i+j==4)s2+=a[i][j];
}
printf("\n");
}
printf("主对角线之和%d,",s1);
printf("次对角线之和%d,",s2);
printf("最大值%d,",max);
printf("最小值%d",min);
}
追答![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/11385343fbf2b2110912704fc08065380cd78ef7?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_600%2Ch_800%2Climit_1%2Fquality%2Cq_85%2Fformat%2Cf_auto)