填空题
在下面横线上填上适当的语句,完成程序。
#include <iostream>
using namespace std;
class Base
int x;
public:
Base(int i) x=i;
~Base()
;
class Derived: public Base
public:
______∥完成类 Derive构造函数的定义
;
int main()
Derived Obj;
return 0;
在横线处应填入的语句是
【9】
。
【参考答案】
Derived(int i):Base(i){
点击查看答案
<上一题
目录
下一题>
热门
试题
填空题
已知 int DBL(int n)return n+n;和 long DBL(long n)return n+n)是一个函数模板的两个实例,则该函数模板的定义是 【13】 。
点击查看答案&解析
填空题
有以下程序: #include <iostream> using namespace std; long fib( int n ) if(n>2) return ( fib( n-1 )+fib( n-2 ) ); else return 2; int main() cout<<fib(3)<<end1; return 0; 则该程序的输出结果应该是 【12】 。
点击查看答案&解析
相关试题
有以下程序 #include <iostream> usi...
有如下程序: #include <iostream> u...
有以下程序 #include <iostream> usi...