您的位置:首页 > 其它

第十三周实践项目课后阅读————2

2016-05-20 22:06 218 查看
问题及代码:

/*copyright(c)2016.烟台大学计算机学院
* All rights reserved,
* 文件名称:text.Cpp
* 作者:吴敬超
* 完成日期:2016年5月20日
* 版本号:codeblock
*
* 问题描述:
* 输入描述:
* 程序输出: 输出结果
*/
#include<iostream>
using namespace std;
class BASE
{
char c;
public:
BASE (char n):c(n){}
virtual ~BASE(){cout<<c;}
};
class DERIVED:public BASE
{
char c;
public:
DERIVED (char n):BASE(n+1),c(n){}
~DERIVED()
{
cout<<c;
}
};
int main()
{
DERIVED d('X');
return 0;
}


运行结果:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: