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

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

根据源代码请回答以下问题。 void sort( int Num, int Type ){ int x = 0; int y = 0; while (Num > 0) { if( Type = = 0) x = y + 2; else { if( Type = = 1 ) x = y + 5; else x = y + 10; } Num--; } } (1) 请画出控制流图并计算控制流图复杂度V(G) 。 (2) 找出独立路径。 (3) 请使用基本路径测试法设计测试用例。 (4) 根据控制流图,找出变量x和y的DU path


参考答案

更多 “ 根据源代码请回答以下问题。 void sort( int Num, int Type ){ int x = 0; int y = 0; while (Num 0) { if( Type = = 0) x = y + 2; else { if( Type = = 1 ) x = y + 5; else x = y + 10; } Num--; } } (1) 请画出控制流图并计算控制流图复杂度V(G) 。 (2) 找出独立路径。 (3) 请使用基本路径测试法设计测试用例。 (4) 根据控制流图,找出变量x和y的DU path ” 相关考题
考题 下列程序的运行结果是()。includevoid fun (int *a,int*b){int*kk=a;a=b;b=k}void 下列程序的运行结果是( )。 #include< iostream.h> void fun (int *a,int*b) {int*k k=a;a=b;b=k} void main() {int a=2004, b=9,*x=a,*y=b; fun(x, y) ; cout<<a<<" "<<b<<endl:}A.20049B.92004C.0D.编译时出错

考题 以下程序执行后的输出结果是( )。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.不确定

考题 以下函数声明中,存在语法错误的是______ 。A.int AA(int a,int);B.int *BB (int,int);C.void CC (int,int=5);D.void*DD (x,y);

考题 以下程序执行后的输出结果是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)