问题 填空题

以下程序中,函数SumColumMin的功能足:求出M行N列二维数组每列元素中的最小值,并计算它们的和值。和值通过形参传回主函数输出。请填空。
#define M 2
#define N 4
void SumColumMm(int a[M][N],int*sum)

int i,j,k,s=0;
for(i=0;i<N;i++)

k=0;
for(j=1;j<M;j++)
if(a[k][i]>a[j][i])
k=j;
s+= 【18】

【19】 =s;

main()

int x[M][n])=3;,5,1,4,1,8,3,s;
SumC01umMm( 【20】 );
ptintf("%d\n",s);

答案

参考答案:a[k][i][AI][答案]*sum[B0][答案]x,&s

解析: 本题定义了一个函数SumColumMin(),该函数有两个参数,第一个参数为数组名,第二个参数为一个指针,用来访问存放数组中每列元素中的最小值的存储空间的变量。所以在主函数中调用SumColunMin()函数,应该将数组x和sam作为实参传给SumColumMin()中的形参,故第20个空格处应该填x,&s。在SumColumMin()函数中用了两重循环,用N记录数组的列,M记录数组的行。内循环共循环了M次,每循环一次将a[k][i]比较a[j][i](当k=0时,a[k][i]第一行第一列的值,然后将该值依次和第一列中的每个值比较,让a[k][i]表示较小的值,那么比较到最后一个元素后a[k][i]就是改列中最小元素的值),让k记录较小值元素的行下标,这样通过 M次循环得到每列中的最小元素,然后退出内循环,继续执行该次外循环里的其他语句,即将刚求得第i列的最小值a[k][i]累加到s中,故第18个空格处应该填a[k][i],最后外循环共循环N次,将每列得最小值累加到s巾,退出循环,然后让指针sum所指向得存储空间得值为s故第19个空格处应该填*sum。

阅读理解

Father of TV

Invention of television began in 1922 in Rigby, Idaho, the hometown of Philo Farnsworth. At the age of 16, Philo was a very shy boy. Only his science teacher, Justin Tolman, realized that Philo was a special person.

One day after school Mr. Tolman found Philo in the classroom. The boy was making drawings on the chalkboard.

“What are you doing?” Mr. Tolman asked with interest, “What are these drawings?”

“I want to invent things,” Philo answered, “and these are the drawings of one of my first inventions. I have an idea for a way of sending pictures through the air. Please, just let me tell you about it. You are the only person who can understand what I have done.” In the school library Philo had read about a man who had worked on an idea for television, but had failed. Philo was sure that his own idea was better and that he could succeed.

Mr. Tolman was not sure and asked Philo many questions about the drawings. Giving facts and figures, Philo answered every question.

In 1926, Philo sent his drawings to Washington, along with a letter asking for the patent rights on television. Since then, television has become an important business all over the world.

小题1:When he lived in his hometown, Philo was _______.

A.quite different from others

B.an active boy

C.an inventor

D.a hard-working boy小题2:When Philo said “You are the only person who can understand what I have done.” In Paragraph 4, his mood was ________.

A.discouraged

B.trusting

C.guilty

D.hopeless小题3:It took Philo ____ to invent the television.

A.2 years

B.6 years

C.4 years

D.8 years小题4:When Mr. Tolman saw Philo’s drawing, he _______.

A.did not believe it was Philo’s invention

B.believed Philo could succeed

C.believed Philo was a special person

D.did not believe Philo could succeed

名词解释