网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

● 给定C 语言程序:

int foo( int x, int y, int d)

{

if( x != 0 ) {

if ( y == 0 ) d = d / x;

else d = d / (x * y );

} else {

if( y == 0 ) d = 0;

else d = d / y;

}

return d ;

}

当用路径覆盖法进行测试时,至少需要设计 (31) 个测试用例。

(31)A. 3 B. 4 C. 5 D. 8


参考答案

更多 “ ● 给定C 语言程序:int foo( int x, int y, int d){if( x != 0 ) {if ( y == 0 ) d = d / x;else d = d / (x * y );} else {if( y == 0 ) d = 0;else d = d / y;}return d ;}当用路径覆盖法进行测试时,至少需要设计 (31) 个测试用例。(31)A. 3 B. 4 C. 5 D. 8 ” 相关考题
考题 下列的程序段中与上题的程序段对y的计算结果相同的是 ______。A.x=34567 y=0 flag=.T. DO WHIL flag y=x% 10+y * 10 x=int(x/10) IF x>0 flag=.F. ENDIF ENDDOB.x=34567 y=0 flag=.T. DO WHIL flag y=x%10+y * 10 x=int(x/10) IF x=0 flag=.F. ENDIF ENDDOC.x=34567 y=0 flag=.T. DO WHIL!flag y=x%10+y* 10 x=int(x/10) IF x>0 flag=.F. ENDIF ENDDOD.x=34567 y=0 flag=.T. DO WHIL!flag y=x%10+y* 10 x=int(x/10) IF x=0 flag=.T. ENDIF ENDDO

考题 下面程序的运行结果是includevoid fun(int * a,int * b){ int x= * a; * a = * b;* 下面程序的运行结果是 #include<iostream.h> void fun(int * a,int * b) { int x= * a; * a = * b; * b=x; cout <<*a<< *b<<""; } void main( 0 { int x =1,y =2; fun(x,y); cout<< x << y <<end1; }A.12 12B.12 21C.21 12D.21 21

考题 以下程序执行后的输出结果是( )。include usingnamespacestd;void try(int,int,int,in 以下程序执行后的输出结果是( )。 #include <iostream> using namespace std; void try(int,int,int,int); int main ( ) { int x,y,z,r; x=1; y=2; try(x,y,z,r); cout<<r<<end1; return 0; } void try(int x,int y, int z,int r) { z = x+y; x = X*X; y = y*y; r = z+x+y; }A.18B.9C.10D.不确定

考题 以下程序执行后的输出结果是include using namespace std;void try(int,int,int,int) 以下程序执行后的输出结果是 #include <iostream> using namespace std; void try(int,int,int,int); int main () { int x,y,z,r; x =1 ; y = 2; try(x,y,z,r); cout<<r<<endl; return 0; } void try(int x,int y,int z,int r) { z = x+y; x = x*x; y = y*y; r = z+x+y; }A.18B.9C.10D.不确定

考题 以下程序执行后的输出结果是includeusing namcspace std;void try(int,int,int,int); 以下程序执行后的输出结果是 #include<iostream> using namcspace std; void try(int,int,int,int); int main() { int x,y,z,r; x=1; y=2; try(x,y,z,r); cout<<r<<end1; return 0; } void try(int x,int y, int z,int r) { z = x+y; x = x*x; y = y*y; r = z+x+y; }A.18B.9C.10D.不确定

考题 以下程序执行后的输出结果是()。includeusing namespace std;void try(int,int,int,in 以下程序执行后的输出结果是( )。 #include<iostream> using namespace std; void try(int,int,int,int); int main() { int x,y,z,r; x=1; y=2; try(x,y,z,r); cout<<r<<endl; return 0; } void try(int x,int y, int z,int r) { z = x+y; X = x*x; y = y*y; r = z+x+y; }A.18B.9C.10D.不确定

考题 以下程序执行后的输出结果是include.using namespace std;void try(int,int,int,int) 以下程序执行后的输出结果是 #include<iostream>. using namespace std; void try(int,int,int,int); int main() { int x,y,z,r; x=1; y=2; try(x,y,z,r); cout<<r<<end1; return 0; } void try(int x,int y, int z,int r) { z = x+y; x = x*x; y = y*y; r = z+x+y; }A.18B.9C.10D.不确定

考题 求y=cos(x)从0到π的积分,正确的命令为_________。A.int(y,x,0,pi)B.int(x,0,pi)C.int(x,y,0,pi)D.int(0,pi,x,y)

考题 10、求y=cos(x)从0到π的积分,正确的命令为_________。A.int(y,x,0,pi)B.int(x,0,pi)C.int(x,y,0,pi)D.int(0,pi,x,y)

考题 5、对于多个输入参数的函数也可以使用递归。下面哪个递归定义是正确的自然数加法?也就是说,对于自然数x,y,plus x y给出x+y。A.plus :: Int - Int - Int plus 0 y = y plus x y = 1 + plus (x-1) yB.plus :: Int - Int - Int plus x 0 = x plus x y = 1 + plus x (y-1)C.plus :: Int - Int - Int plus x y = 1 + plus (x-1) y plus 0 y = yD.plus :: Int - Int - Int plus 0 y = y plus x y = 1 + plus (x-1) (y-1)