请使用VC6或使用[答题]菜单打开考生文件夹proj1下的工程proj1,此工程中含有一个源程序文件proj1.cpp。其中位于每个注释“//ERROR****found****”之后的一行语句存在错误。请改正这些错误,使程序的输出结果为: Constructor called. The value is 10 Max number is 20 Destructor called. 注意:只能修改注释“//ERROR****found****”的下一行语句,不要改动程序中的其他内容。 // proj1.cpp #include <iostream> using namespace std; class MyClass public: //ERROR**********found********** void MyClass(int i) value=i;cout<<"Constructorcalled."<<endl; int Max(int x,int y)return x>yx:y;//求两Ai整数的最大值 //ERROR**********found********** int Max(int x,int y,int z=0) //求三个整数的最大值
if(x>y) return x>zx:z; else return y>zy:z;
int GetValue()constreturn value; ~MyClass()cout<<"Destructorcalled."<<endl; private: int value; ; int main ()
MyClass obj(10); cout<<"The value is"<<value()<<endl; cout<<"Max number is"<<obj.Max(10,20)<<endl; return 0;