实验三

实验内容
1.//sy_3.1cpp正确程序如下“
//sy3_1.cpp

include

using namespace std;
class Aa
{
public:
Aa(int i=0){a=i;cout<<”Constructor”<

include

using namespace std;
class TPoint
{
public:
TPoint(int x=0,int y=0){X=x,Y=y;}
TPoint(TPoint &p);
~TPoint(){cout<<”Destructor is called\n”;}
int getx(){return X;}
int gety(){return Y;}
private:
int X,Y;
};
TPoint::TPoint(TPoint &p)
{
X=p.X;
Y=p.Y;
cout<<”Constructor is called\n”;
cout<<”Copy-initialization Constructor is called\n”;
}
int main()
{
TPoint p1(4,9);
TPoint p2(p1);
TPoint p3=p2;
TPoint p4,p5(2);
cout<<”p3=(“<

include

using namespace std;
class Heapclass
{
public:
Heapclass(int x);
Heapclass();
~Heapclass();
private:
int i;
};
Heapclass::Heapclass(int x)
{
i=x;
cout<<”Contstructor is called. “<

include

using namespace std;
class Rectangle
{
public:
Rectangle(){len=0;wid=0;}
Rectangle(double Len,double Wid){len=Len;wid=Wid;}
double Circumference(){return 2*(len+wid);}
double Area(){return len*wid;}
double getl(){return len;}
double getw(){return wid;}
void charge(double a,double b){len=a;wid=b;}
printf()
{
cout<<”length:”<

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值