在下面程序的横线处填上适当的语句,使该程序的执行结果为200.#includeclass number{private:int val;public:number(int i){val=i;}____________int(); } ;number::operator int(){___________}class num:public number{public:num(int i):number(i){}};void main(){num n(100);int i =n;_____________}

问题描述:

在下面程序的横线处填上适当的语句,使该程序的执行结果为200.
#include
class number{
private:
int val;
public:
number(int i){val=i;}
____________int();
} ;
number::operator int(){___________}
class num:public number{
public:
num(int i):number(i){}
};
void main(){
num n(100);
int i =n;
_____________
}

#includeclass number{private:int val;public:number(int i){val=i;}operator int(); // 填空1} ;number::operator int(){return val *= 2;} //填空2class num:public number{public:num(int i...