问答题
return 0;
【参考答案】
(1)
virtual void add(int a)=0;
(2)
fl......
(↓↓↓ 点击下方‘点击查看答案’看完整答案、解析 ↓↓↓)
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
使用VC6打开考生文件夹下的工程test39_1,此工程包含一个源程序文件test39_1.cpp,但该程序运行有问题,请改正函数中的错误,使该程序的输出结果为; This is static a: 1 This is non-static b: 1 This is static a: 2 This is non-static b: 2 This is static a: 2 This is non-static b: 1 Press any key to continue 源程序文件test39_1.cpp清单如下; #include<iostream.h> class shared static int a; int b; public: ***************** found ***************** void set(int i=0, int j) a=i; b=j; void show(); ; ***************** found ***************** void shared::show() cout << This is static a: << a; cout << nThis is non-static b: << b; ***************** found ***************** cout >> n ; void main () shared x, y; x.set (1, 1); x.show ( ); y.set (2, 2); y.show ( ); x.show ( );
点击查看答案&解析
问答题
请编写函数fun(),该函数的功能是将M行N列的二维数组中的数据,按列的顺序依次放到一维数组中。 例如:二维数组中的数据为 33333333 44444444 55555555 则一维数组中的内容应是 334455334455334455334455。 注意:部分源程序以存在文件test_2.cpp中。 请勿改动主函数main和其他函数中的任何内容,仅在函数fun的花括号中填入所编写的若干语句。 文件test39_2.cpp的内容如下: #include<stdio.h> #include<iostream.h> void fun(int(*s) [10],int *b, int *n,int mm,int nn) void main( ) int w[10][10]=33,33,33,33,44,44,44,44,55,55,55,55,i,j; int a[100]=0, n=0; cout<< The matrix: n for(i=0; i<3; i++) for(j=0; j<4; j++ cout<<w[i] [j]; cout<<endl; fun(w, a, &n, 3, 4); cout<< The A array: n ; for(i=0; i<n; i++) cout<<a[i]; cout<< n n ;
点击查看答案&解析
相关试题
请编写函数fun(),该函数的功能是将M行N...
使用VC6打开考生文件夹下的工程test39_...