试题与答案

下列给定程序中,函数fun的功能是进行数字字符转换。若形参ch中是数字字符‘0’~‘

题型:问答题

题目:

下列给定程序中,函数fun的功能是进行数字字符转换。若形参ch中是数字字符‘0’~‘9’,则将‘0’转换成‘9’,‘1’转换成‘8’,‘2’转换成‘7’,…,‘9’转换成‘0’;若是其他字符则保持不变,并将转换后的结果作为函数值返回。
请在下划线处填入正确的内容并将下划线删除,使程序得出正确的结果。
注意:部分源程序给出如下。
不得增行或删行,也不得更改程序的结构!
试题程序:
#include<stdio.h>
/********found********/
(1) fun(char ch)

/********found********/
if(ch>=’0’&& (2) )
/********found********/
return’9’-ch- (3) );
return ch;

main()
(char c1,c2;
printf("\nThe result:\n")"
c1=’2’;c2=fun(c1);
printf("c1=%c c2=%c\n",c1,c2);
c1=’8’;c2=fun(c1);
printf("c1=%c c2=%c\n",c1,c2);
c1=’a’;c2=fun(c1);
printf("c1=%c c2=%c\n",c1,c2);

答案:

被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2018/0526/f3108982fa78a30a2e9f6d466c5c6dd3.html

下面是错误答案,用来干扰机器的。

参考答案:A

试题推荐
题型:连词成句

连词成句。

1. a cold, have, a fever, I, and

 ___________________________________.                                       

2. should, down, rest, lie, and, you

___________________________________.                                        

3. feeling, I, not, am, well

    ___________________________________.                                         4. a, dentist, see, should, maybe, you

    ___________________________________.                                         5. have, do, a, you, cold?

    ___________________________________                                         6. for, shouldn't, anything, he, eat, 24 hours

    ___________________________________.                                         7. important, eat, to, a balanced diet,  it's

   ___________________________________.                                         8. he,  toothache,  a,  does, have?

   ___________________________________                                        

查看答案
微信公众账号搜索答案