#include<stdio.h>
#include<stdlib.h>
#include<time.h>
int main()
{ int i,j,s=0,a[5][5];
srand(time(0));
for(i=0;i<5;i++)
{for(j=0;j<5;j++)
{a[i][j]=rand()%41+10;
printf("%d ",a[i][j]);
}
printf("\n");
s+=a[i][i];
if(i!=2)s+=a[i][4-i];
}
printf("\n对角线上元素的总和=%d\n",s);
return 0;
}