填空题
分析以下程序的执行结果______。
#include<iostream.h>
class Sample
{
int x,y;
public:
Sample(){x=y=0;}
Sample(int a,int b){x=a;y=b;)
~Sample()
{
if(x==y)
cout<<"x=y"<<end1;
else
cout<<"x!=y"<<end1;
}
void disp()
{
cout<<"x="<<x<<",y="<<y>>end1;
}
};
void main()
{
Sample s1(2,3);
s1.disp();
}
【参考答案】
x=2,y=3