已知IN7.DAT中存有200个4位数,并已调用读函数readDat()把这些数存入

题型:问答题

问题:

已知IN7.DAT中存有200个4位数,并已调用读函数readDat()把这些数存入数组a中,请编制一函数jsVal(),其功能是:依次从数组a中取出一个数,如果该4位数连续大于该4位数以后的5个数且该数是奇牧,则统计出满足此条件的数的个数cnt,并把这些4位数按从小到大的顺序存入数组b中,最后调用写函牧writeDat()把结果cnt及数组b中符合条件的4位数输出到OUT7.DAT文件中。
注意:部分源程序已给出。
程序中已定义数组:a[200],b[200],已定义变量:cnt。
请勿改动主函数main()、读函数readDat()和写函数wfiteDat()的内容。
试题程序:
#include<stdio.h>
#define MAX 200
int a[MAX],b[MAX],cnt=0;
void writeDat();
void jsVal()


void readDat()

int i;
FILE * fp;
fp=fopen("IN7.DAT","r");
for(i = 0; i < MAX; i++) fscanf(fp,"%d", &a[i]);
close(fp);

main()

int i;
readDat();
jsVal();
printf("满足条件的数=%d\n", cnt);
for(i=0; i < cnt; i++ printf("%d ", b[i]);
printf("\n");
writeDat()

void writeDat )

FILE * fp;
int i;
fp = fopen("OUT7.DAT", "w");
fprintf(fp, "%d\n", cnt);
for(i = 0; i < cnt; i++) fprintf(fp, "%d\n", b[i]);
fclose(fp);

考点:计算机等级考试数据库技术三级数据库技术机试
题型:问答题
将函数y=sinx的图象向左平移φ(0≤φ<2π)个单位后,得到函数y=sin(x-
π
6
)的图象,则φ等于(  )
A.
π
6
B.
6
C.
6
D.
11π
6
题型:问答题

Kenya is losing an average of 100 of its 2,000 lions each year because of growing human settlements, increasing farming, climate change and diseases, according to the Kenya Wildlife Service (KWS).

“Lions have a special place in Kenyans’ life,” said Paul Udoto, a spokesman for the organization.  “Other than being the symbol of national strength, they are among the Big Five, a main attraction for visitors to Kenya.”

There were 2,749 lions in Kenya in 2002 and their population dropped to 2,280 by 2004 and to about 2,000 today, according to KWS figures.

“The fall of the lion population is worrying and every effort needs to be made to make sure that Kenya either protects its population of 2,000 lions at present or increases the numbers to an ecologically (生态上地) acceptable level,” said Mr. Udoto.

“There is no doubt that the numbers are in free fall. I’d be surprised if they even last as long as 20 years,” said Laurence Frank, project director of Living With Lions, a Kenya-based animal protection organization. “When I first came here 30 years ago, I would always hear lions roaring across the land at night and see their tracks in the morning. Now that is very rare.”

“The reason is simple. As the numbers of people grow and the numbers of cows increase, they take up much of the lion’s space. Alongside that there are other ways, including poisoning, to kill lions.”

Animal lovers are making a new strategy to save the animals. Part of the measures will include tracking lions fitted with radio collars (无线电项圈) in the Amboseli area in southern Kenya, close to the border with Tanzania.

Wildlife officials in Tanzania face similar challenges in protecting their lions, but there is far less human encroachment(侵犯) on the animals’ homeland there than in Kenya.

小题1:The lion population is falling in Kenya for the following reasons EXCEPT __________.

A.climate change

B.too many visitors

C.disease

D.human activities小题2:In Paragraph 2, Paul Udoto wants to show __________.

A.the importance of lions in Kenya

B.the tourist attractions in Kenya

C.Kenyan’s special lifestyle

D.Kenya’s national symbol小题3:We know from Laurence Frank’s words that __________.

A.lions are losing their attraction for visitors to Kenya

B.the lion population will be controlled from now on

C.lions will disappear within twenty years in Kenya if not protected

D.more cows are needed to feed lions in Kenya小题4: What is the main idea of the passage?

A.Kenya is losing its Big Five.

B.Kenyan wildlife is in danger.

C.Lions face extinction in Kenya.

D.Lions’ place in Kenyans’ life is falling.小题5:What will the following passage most probably talk about?

A.Lions’ past living condition in Kenya.

B.Ways of improving lions’ condition.

C.Radio collars tracing lions.

D.Lions’ present living condition in Tanzania

题型:问答题

以下有关强迫性中断事件的叙述中,哪一个是不正确的

A.输入输出中断是来自通道或者各种外部设备的中断,用于反映通道或设备的工作情况

B.硬件故障中断是机器发生错误时产生的中断

C.时钟中断是软件时钟到时而引起的中断

D.程序性中断是正在运行程序中有意识安排而引起的中断

题型:问答题

如果没有违法行为,就无需承担法律责任,而且合法的行为还应受到法律的( )。

A.鼓励
B.表扬
C.保护
D.称赞

题型:问答题

以玉米为主食的居民中易发生()

A.脚气病

B.佝偻病

C.坏血病

D.癞皮病

E.干眼病

更多题库