在下面程序的横线处填上适当的语句,使该程序的执行结果为200.#includeclass number{private:int val;public:number(int i){val=i;}____________int(); } ;number::operator int(){___________}class num:public number{public:num(int i):num
来源:学生作业帮助网 编辑:作业帮 时间:2024/08/28 22:37:40
![在下面程序的横线处填上适当的语句,使该程序的执行结果为200.#includeclass number{private:int val;public:number(int i){val=i;}____________int(); } ;number::operator int(){___________}class num:public number{public:num(int i):num](/uploads/image/z/14022018-18-8.jpg?t=%E5%9C%A8%E4%B8%8B%E9%9D%A2%E7%A8%8B%E5%BA%8F%E7%9A%84%E6%A8%AA%E7%BA%BF%E5%A4%84%E5%A1%AB%E4%B8%8A%E9%80%82%E5%BD%93%E7%9A%84%E8%AF%AD%E5%8F%A5%2C%E4%BD%BF%E8%AF%A5%E7%A8%8B%E5%BA%8F%E7%9A%84%E6%89%A7%E8%A1%8C%E7%BB%93%E6%9E%9C%E4%B8%BA200.%23includeclass+number%7Bprivate%3Aint+val%3Bpublic%3Anumber%28int+i%29%7Bval%3Di%3B%7D____________int%28%29%3B+%7D+%3Bnumber%3A%3Aoperator+int%28%29%7B___________%7Dclass+num%3Apublic+number%7Bpublic%3Anum%28int+i%29%3Anum)
在下面程序的横线处填上适当的语句,使该程序的执行结果为200.#includeclass number{private:int val;public:number(int i){val=i;}____________int(); } ;number::operator int(){___________}class num:public number{public:num(int i):num
在下面程序的横线处填上适当的语句,使该程序的执行结果为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;
_____________
}
在下面程序的横线处填上适当的语句,使该程序的执行结果为200.#includeclass number{private:int val;public:number(int i){val=i;}____________int(); } ;number::operator int(){___________}class num:public number{public:num(int i):num
#include
class number{
private:
int val;
public:
number(int i){val=i;}
operator int(); // 填空1
} ;
number::operator int(){return val *= 2;} //填空2
class num:public number{
public:
num(int i):number(i){}
};
void main(){
num n(100);
int i = n;
cout