使用VC6打开考生文件夹下的工程RevProj15。此工程包含一个源程序文件RevMain15.cpp,但该程序中类的定义有错误。请改正程序中的错误,使它能得到正确结果。 注意,不要改动主函数,不得删行或增行,也不得更改程序的结构。 源程序文件RevMain15.cpp中的程序清单如下: //RevMain15.cpp #include<iostream> using namespace std; class Sample
private: int x; static int y; public: Sample(int a)
x=a; y+=x;
static void print(Sample s)
cout<<"x="<<x<<<<",y="<<y<<end1;
Sample::y=5; int main()
Sampel s1(10); Sample s2(15); Sample::print(s1); Sample::print(s2); return 0;