4、给定程序中,函数fun的功能是:有N×N矩阵,以主对角线为对称线,对称元素相加并将结果存放在左下三角元素中,右上三角元素置为0。例如,若N=3,有下列矩阵:
1 2 3
4 5 6
7 8 9计算结果为
1 0 0
6 5 0
10 14 9
请在程序的下划线处填入正确的内容并把下划线删除,使程序得出正确的结果。
注意:源程序存放在考生文件夹下的BLANK1.C中。
不得增行或删行,也不得更改程序的结构!
#include #define N 4
/**********found**********/
void fun(int (*t)___1___ )
{ int i, j;
for(i=1; i /**********found**********/
___2___ =t[i][j]+t[j][i];
/**********found**********/
___3___ =0;
}
}
}
main()
{ int t[][N]={21,12,13,24,25,16,47,38,29,11,32,54,42,21,33,10}, i, j;
printf("\nThe original array:\n");
for(i=0; i }
fun(t);
printf("\nThe result is:\n");
for(i=0; i }
}
| 广告合作:400-664-0084 全国热线:400-664-0084 Copyright 2010 - 2017 www.my8848.com 珠峰网 粤ICP备15066211号 珠峰网 版权所有 All Rights Reserved
|