以下函数用来求出两整数之和,并通过形参将结果传回,请填空。Void func(int x,int y,z){ *z-x+y; },
第1题:
设函数findbig已定义为求3个数中的最大值。以下程序将利用函数指针调用findbig函数,请填空。main(){ int findbig(int,int,int); int (*f)(),x,y,z,big; f=; scanf("%d%d%d",&x,&y,&z); big=(*f)(x,y,z); printf("big=%d\n",big);}
第2题:
以下程序执行后的输出结果是 #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.18
B.9
C.10
D.不确定
第3题:
【填空题】无返回值函数fun用来求出两整数x,y之和,并通过形参z将结果传回,假定x,y,z均是整型,则函数应定义为____。
第4题:
以下程序执行后的输出结果是 #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.18
B.9
C.10
D.不确定
第5题:
x,y是整数型变量,z产生一个范围在[y,x]之间的随机整数的语句是( )。
A.z=Int(Rnd*(y-x+1))+x
B.z=Int(Rnd*y) + x
C.z=Int(Rnd*x)+y
D.z=Int(Rnd*(y-x)) + x