问题 多项选择题

fclose(fp);

答案

参考答案:void jsVal()
{
int i, j, flag=0;
for(i=E; i〈MAX-E; i++) /*如果D位数连续大于该数以前的E个数,则置flag为A,否则取下一个数*/
{
for(j=i-E; j〈i; j++)
{
if(a[i]>a[j])
flag=A;
else
{flag=0; break;}
}
if(flag==A && a[i]%B==A && a[i]%G==0) /*如果flag为A且该数是奇数,该数能被G整除,则将该数存入数组b中,并统计满足条件的数的个数*/
{
b[cnt]=a[i];
cnt++;
}
}
for(i=0; i〈cnt-A; i++) /*将数组b中的数按从大到小的顺序排列*/
for(j=i+A; j〈cnt; j++)
if(b[i]〈b[j])
{
flag=b[i];
b[i]=b[j];
b[j]=flag;
}
}

解析: 根据题意可知,要编制函数的功能有两部分:一是找出满足条件的4位数,二是对找出的数进行从大到小排序。首先利用一个for循环来依次从数组中取得4位数,接着拿当前得到的4位数与该数前面的连续的5个数依次进行比较。如果该数比它前面的5个数都大,则给标志变量flag赋值1,接着对flag进行判断,如果不为1,则该数肯定不符合条件,直接去取下一个数。若flag值为1,再来判断该数是否是奇数,如果恰好该数又能被7整除,则把该数添加到数组b中。这样就可以依次取出符合条件的数。然后利用选择法对数组b中的元素进行从大到小的排序。

阅读理解

Once there was a piano player in a bar(酒吧). People came just to hear him play. But one night, a lady asked him to sing a song.

"I don't sing," said the man.

But the lady told the waiter, "I'm tired of listening to the piano. I want the player to sing!"

The waiter shouted across the room, "Hey, friend! If you want to get paid, sing a song!"

So he did. He had never sung in public before. Now he was singing for the very first time! Nobody had ever heard the song Mona Lisa sung so beautifully!

He had talent(天赋) he was sitting on! He may have lived the rest of his life as a no-name piano player in a no-name bar. But once he found, by accident, that he could sing well, he went on working hard and became one of the best-known singers in the US. His name was Nat King Cole.

You, too, have skills and abilities. You may not feel that your talent is great, but it may be better than you think. With hard work, most skills can be improved. Besides, you may have no success at all if you just sit on your talent.

小题1:The lady asked the player to sing a song because _____.

A.she had paid him for this

B.she knew him very well

C.she wanted to have a change

D.she enjoyed his singing小题2:Nat King Cole succeeded because _____.

A.the lady helped him a lot

B.he caught the chance

C.he continued to play in the bar

D.he stopped playing the piano小题3:The words "sit on" in the passage probably mean" ___________.”

A.fail to realize

B.forget to use

C.try to develop

D.manage to show小题4:From the story we know if you have some talent, you should _____.

A.hide it and wait

B.ask others for help

C.pay no attention to it

D.work hard to improve yourself小题5:Which could be the best title (标题) for the passage?

A.Sing in the Bar

B.Achieve Success in Life

C.Never Lose Heart

D.Find Your Hidden Talent

解答题