已知数据文件IN44.DAT中存有300个4位数,并已调用读函数readDat()把这些数存入数组a中,请编制一函数isValue(),其功能是:求出千位数上的数减百位数上数减十位数上的数减个位数上的数大于零的数的个数cnt,再把所有满足此条件的4位数依次存入数组b中,然后对数组b的4位数按从小到大的顺序进行排序,最后调用写函数writeDat()把数组b中的数输出到OUT44.DAT文件中。
例如:9123,9-1-2-3>0,则该数满足条件,存入数组b中,且个数cnt=cnt+1。
9812,9-8-1-2<0,则该数不满足条件,忽略。
注意:部分源程序已给出。
程序中已定义数组:a[300],b[300],己定义变量:cnt。
请勿改动主函数main()、读函数readDat()和写函数writeDat()的内容。
试题程序:
include<stdio.h>
int a[300],b[300],cnt=0;
jsValue()
{
}
main ()
{
iht i;
readDat();
jsValue();
writeDat();
for(i=0;i<cnt;i++)
printf("b[%d]=%d\n",i,b[i]);
}
readDat()
{
FILE *fp;
int i;
fp=fopen("IN44.DAT","r");
printf ("cnt=%d\n", cnt);
for (i=0;i<300; i++)
fscanf (fp, "%d, ", &a [i] );
fclose (fp);
}
writeDat ()
{
FILE *fp;
int i;
fp=fopen ("OUT44. DAT" , "w" );
fprintf (fp, "%al\n", cnt);
for (i=0; i<cnt;i++)
fprintf(fp, "%d\n",b[i]);
fclose (fp);
}
Part B (10 points)
You are going to read a list of headings and a text about unknown knowledge on AIDS. Choose the most suitable heading from the list for each numbered paragraph. The first paragraphs of the text are not numbered. There is one extra heading which you do not need to use.
In the 20 years since the first cases of AIDS were detected, scientists say they have learned more about this viral disease than any other.
Yet Peter Piot, who directs the United Nations AIDS program, and Stefano Vella of Rome, president of the International AIDS Society, and other experts say reviewing unanswered questions could prove useful as a measure of progress for AIDS and other diseases.
Among the important broader scientific questions that remain:
(41)______.
A long-standing belief is that cancer cells constantly develop and are held in check by a healthy immune system. But AIDS has challenged that belief. People with AIDS are much more prone to certain cancers like non-Hodgkins lymphomas and Kaposi's sarcoms, but not to breast, colon and lung, the most common cancers in the United States. This pattern suggests that an impaired immune system, at least the type that occurs in AIDS, does not allow common cancers to develop.
(42)______.
When HIV is transmitted sexually, the virus must cross a tissue barrier to enter the body. How that happens is still unclear. The virus might invade directly or be carried by a series of different kinds of cells.
Eventually HIV travels through lymph vessels to lymph nodes and the rest of the lymph system. But what is not known is how the virus proceeds to destroy the body's CD-4 cells that are needed to combat invading infectious agents.
(43)______.
Although HIV kills the immune cells sent to kill the virus, there is widespread variation in the rate at which HIV infected people become ill with AIDS. So scientists ask: Can the elements of the immune system responsible for that variability be identified? If so, can they be used to stop progression to AIDS in infected individuals and possibly pre vent infection in the first place?
(44)______.
In theory, early treatment should offer the best chance of preserving immune function. But the new drugs do not completely eliminate HIV from the body so the medicines, which can have dangerous side effects, will have to be taken for a lifetime and perhaps changed to combat resistance. The new policy is expected to recommend that treatment be deferred until there are signs the immune system is weakening.
Is a vaccine possible?
There is little question that an effective vaccine is crucial to controlling the epidemic. Yet only one has reached the stage of full testing, and there is wide controversy over the degree of protection it will provide. HIV strains that are transmitted in various areas of the world differ genetically. It is not known whether a vaccine derived from one type of HIV will confer protection against other types.
(45)______.
Without more incisive, focused behavioral research, prevention messages alone will not put an end to the global epidemic.
A. What route does HIV take after it enters the body to destroy the immune system?
B. How and when did the long-standing belief concerning AIDS and HIV crop up?
C. What is the most effective anti-HIV therapy?
D. How does HIV subvert the immune system?
E. In the absence of a vaccine, how can HIV be stopped?
F. Why does AIDS predispose infected persons to certain types of cancer and infections?