问题 问答题

fclose(fp);

答案

参考答案:void encryChar()
{ int i;
char*pf;
for(i=0;i<maxline;i++)
{
pf=xx[i]; /*指针pf指向该行首地址*/
while(*pf!=0)
{
if((*pf>= ’A’&& *pf<=’Z’)|| *pf*11%256<=32)
/*如果原字符是大写字母或计算后的值小于等于32*/
{
pf++; /*则此字符不变,取下一个字符*/
continue; /*退出此次循环*/
}
*pf=*pf*11%256; /*如果不满足条件,则用新字符替代原字符*/
pf++; /*取下一个字符*/
}
}
}

解析: 本题考查的知识点如下:
(1)字符对应的ASCH码。
(2)判断结构中多个条件的“或”运算。
(3)退出一次循环。
在C语言中,字符可参与任何整数运算。实际上,是字符的ASCH码参与了运算。所以可以直接用字符代入f(p)的关系式中求出替换字符。若原字符是大写字母或玎p)≤32,则该字符不变。只有当字符大于等于A小于等于z时,才是大写字母,所以这两个条件之间用“与”运算。而字符是大写字母与f(p)≤32之间为或的关系,所以这两个条件之间用“或”运算。若字符不变,则可不必计算替换字符,使用continue退出本次循环,进入下一次循环的条件判断中。因为这里不是直接退出循环结构,所以不能使用break语句。

单项选择题

Passage Three

Some people would say that the Englishman’s home is no longer his castle, and that it has become his workshop. This is partly because the average Englishman is keen on working with his own hands and partly because he feels, for one reason or another, that he must do for himself many households for which, some years ago, he would have hired professional help. The main reason for this is a financial one. The high cost of labor has meant that builders’ and decorators’ cost have reached a level which makes them prohibitive for house-proud English people of modest means. So, if they wish to keep their houses looking bright and smart, they have to tackle some of the repairs and decorating themselves. As a result, there has grown up in the post-war years what is sometimes referred to as the "do-it-yourself movement".
The "do-it-yourself movement" began with home decorating but has since spread into a much wider field. Nowadays there seem to be very few things that can’t be made by the "do-it-yourself movement" method. A number of magazines and handbooks exist to show hopeful handymen of all ages just how easy it is to build anything from a coffee table to a fifteen foot (4.5 meters) sailing dinghy. All you need, it seems, is a hammer and a few nails. You follow the simple instructions step by step and, before you know where you are, the finished article stands before you, completely in every detail.
Unfortunately, alas, it is not always quite as simple as it sounds. Many a budding "do-it- yourself" has found to his cost that one cannot learn a skilled craftsman’s job overnight. How quickly one realizes, when doing it oneself, that a job which takes the skilled man an hour or so to complete takes the amateur handyman five or six at least. And then there is the question of tools. The first thing the amateur learns is that he must have the right tools for the job. But tools cost money. There is also the wear and tear on the nerves. It is not surprising then that many people have come to the conclusion that the expense of paying processional to do the work is, in the long run, more economical than "do-it-yourself "

The word "budding" (Line 1, Para. 3) probably means ______.

A.flourishing

B.promising

C.undeveloped

D.skillful

单项选择题