第十三周实践项目课后阅读————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; }
运行结果:
相关文章推荐
- Javascript模块化编程(一):模块的写法
- ListView滑动时CheckBox出现数据错乱
- modelsim10.2c安装教程
- HDU 1695(数论,筛选+素因子分解+容斥)
- Ubuntu下安装GTK+及Glade开发C应用界面
- 循环数组打印
- 序列化的作用
- 爬虫xpath学习
- hdu5188zhx and contest [01背包至少li才能。。。]
- 训练3 习题15
- 喜剧者联盟观后感
- 饿了么开源项目Hermes:新颖巧妙易用的Android进程间通信IPC框架
- 转发与重定向区别
- TCP/IP协议原理与应用笔记21:路由选择的方法
- eclipse的应用技巧(一)
- 滴滴算法大赛算法解决过程(实时更新)
- Swift专题讲解十六——ARC在Swift中的应用
- 【bzoj 1042】 [HAOI2008] 硬币购物(dp+容斥原理)
- POJ 2385 Apple Catching
- 在Django中使用markdown