问题 单项选择题 A1/A2型题

感受头部的角加速度变化所引起的刺激的运动位置感受器是()。

A.骨半规管

B.壶腹嵴

C.椭圆囊斑

D.球囊斑

E.膜半规管

答案

参考答案:B

解析:感受头部的角加速度变化所引起的刺激的运动位置感受器是壶腹嵴。

问答题

已知检查括号匹配及注释、字符串处理的C源程序如下:

#include<stdio.h>

int brace,brack,paren;

void in_quote(int c);

void in_comment(void);

void search(int c);

/*rudimentary syntax checKer for C program*/

int main()

int c;

extern int brace,brack,paren;

while((c=getchar())!=EOF)

if(c==’/’)

if((c=getchar())==’*’)

in_comment(); /*inside comment*/

else

search(C) ;

else if(c==’\"||c=="")

in_quote(c); /*inside quote*/

else

search(c);

if(brace<0) /*output errors*/

printf("Unbalanced braces\n");

brace=0;

else if(brack<0)

printf("Unbalanced brackets\n");

brack=0;

else if(paren<0)

printf("Unbalanced parentheses\n");

paren=0;

if(brace>0) /*output errors*/

printf("Unbalanced braces\n");

if(brack>0)

printf("Unbalanced brackets\n");

if(paren>0)

printf("Unbalanced parentheses\n");

return 0;

/*search:search for rudimentary syntax errors*/

void search(int c)

extern int brace,brack,paren;

if(c==’’)

++brace;

else if(c==’’)

--brace;

else if(c==’[’)

++brack;

else if(c==’]’)

--brack;

else if(c==’(’)

++paren;

else if(c==’)’)

--paren;

/*in_comment:inside of a valid comment*/

void in_comment(void)

int c,d;

c=getchar();

d=getchar(); /*curr character*/

while(c!=’*’||d!=’/’) /*search for end*/

c=d;

d=getchar();

/*in_quote:inside quote*/

void in_quote(int c)

int d;

while((d=getchar())! =c) /*search end quote*/

if(d==’\\’)

getchar(); /*ignore escape seq*/

设计一组测试用例,使该程序所有函数的语句覆盖率和分支覆盖率均能达到100%。如果认为该程序的语句覆盖率或分支覆盖率无法达到100%,需说明为什么。

单项选择题