数据结构习题:在顺序表类定义中增设一个函数成员,实现删除线性表中从第i个元素起的k个元素并进行测试。
数据结构线性表习题:在顺序表类定义中增设一个函数成员,实现删除线性表中从第i个元素起的k个元素并进行测试。怎么写?大家帮帮忙,O(∩_∩)O谢谢...
数据结构线性表习题:在顺序表类定义中增设一个函数成员,实现删除线性表中从第i个元素起的k个元素并进行测试。怎么写?大家帮帮忙,O(∩_∩)O谢谢
展开
1个回答
2013-08-24
展开全部
#include <iostream.h>
class mammal
{
public:
mammal()
{
cout<<"it is a mammal"<<endl;
}
void age()
{
cout<<"mammal age"<<endl;
}
void weight()
{
cout<<"mammal weight"<<endl;
}
~mammal()
{
cout<<"destory mammal"<<endl;
}
};
class dog:public mammal
{
public:dog()
{
cout<<"it is a dog"<<endl;
}
void weight()
{
cout<<"dog`s weight"<<endl;
}
~dog()
{
cout<<"destory dog class"<<endl;
}
};
void main()
{
dog dg;
}
如果帮助到您,请记得采纳为满意答案哈,谢谢!祝您生活愉快! vae.la
class mammal
{
public:
mammal()
{
cout<<"it is a mammal"<<endl;
}
void age()
{
cout<<"mammal age"<<endl;
}
void weight()
{
cout<<"mammal weight"<<endl;
}
~mammal()
{
cout<<"destory mammal"<<endl;
}
};
class dog:public mammal
{
public:dog()
{
cout<<"it is a dog"<<endl;
}
void weight()
{
cout<<"dog`s weight"<<endl;
}
~dog()
{
cout<<"destory dog class"<<endl;
}
};
void main()
{
dog dg;
}
如果帮助到您,请记得采纳为满意答案哈,谢谢!祝您生活愉快! vae.la
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询