问题 填空题

下列给定程序中,函数fun的功能是:有N×N矩阵,以主对角线为对称线,对称元素相加并将结果存放在左下三角元素中,右上三角元素置为0。
例如,若N=3,有下列矩阵:
1 2 3
4 5 6
7 8 9
计算后结果为:
1 0 0
6 5 0
10 14 9
请在下划线处填入正确的内容并把下划线删除,使程序得出正确的结果。
注意:部分源程序给出如下。
不得增行或删行,也不得更改程序的结构!
试题程序:
#include<stdio.h>
#define N 4
/*************found**********/
voidfun(int(*t)______)

int i,j;
for(i=1;i<N;i++)

for(j=0;j<i;j++)

/**********found***********/
______=t[i][j]+t[j][i];
/***********found*********/
______=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<N;i++)

for(j=0;j<N;j++)
printf("%2d",t[i][j]);
printf("\n");

fun(t);
printf("\nThe result is:\n");
for(i=0;i<N;i++)

for(j=0;j<N;j++)
printf("%2d",t[i][j]);
printf("\n");

答案

参考答案:[N] t[i][j] t[j][i]

解析: 填空1:主函数中调用函数的参数为二维数组,所以此处形参应定义为指针数组。
填空2:根据题意可知,对称元素相加的和存放在左下三角元素中,那么应填入的是t[i][j]。
填空3:右上三角元素置0,应填入t[j][i]。

完形填空
完形填空。
     The day before Clara's birthday, she was very 1 . She hoped she would get lots  of   presents.  She went to her
bedroom, and began to 2 a letter to her mother. 3 the letter, she said she would like to go on a picnic and open her
presents during the picnic. Clara gave her mom the letter and her mom said, "Thanks, dear. Go to bed 4 I'll read it."
Clara went to bed with her favorite teddy bear. Her mom 5 her face and said, "Good night."
     Early next morning, Clara put on her 6 and went to the living room.  Her mom was 7 things for the picnic. After
breakfast, the family 8 their car to the park. They found a good place.   Clara unwrapped her presents. There were
beautiful skirts, dolls and books. Finally, Mom took out the last present. It was a 9 box. Clara opened the box and
found a pot. A lovely fish was swimming in it. Clara was so happy. Now, she still remembers that birthday 10 .
( )1. A. surprised  
( )2. A. send      
( )3. A. On        
( )4. A. but        
( )5. A. saw        
( )6. A. bags      
( )7. A. making    
( )8. A. drove      
( )9. A. broken    
( )10.A. right now  
B. pleased  
B. draw      
B. In        
B. so        
B. washed    
B. clothes  
B. planting  
B. mended    
B. ugly      
B. at first  
C. relaxed      
C. write        
C. From        
C. and          
C. forgot      
C. glasses      
C. borrowing    
C. stopped      
C. bright      
C. all the time
D. worried      
D. find        
D. Before      
D. or          
D. kissed      
D. gloves      
D. preparing    
D. cleaned      
D. pretty      
D. just now    
单项选择题