4.20
2015-06-29 23:37
141 查看
01.#include<iostream> 02.#include<string> 03.using namespace std; 04.class book 05.{ 06.public: 07. book(int a) 08. { qu=a; 09. price=10*a; 10. } 11. void show() 12. { 13. cout<<qu*price<<endl; 14. } 15.private: 16. int qu; 17. int price; 18.}; 19.int main() 20.{ 21. book book1[5]={book(1),book(2),book(3),book(4),book(5)}; 22. 23. int i; 24. book* p=book1; 25. for( i=1;i<=4;i++) 26. { 27. p[4-i].show(); 28. } 29. return 0; 30.}
相关文章推荐
- Newtonsoft.Json高级用法
- Java enum的用法详解
- (一)html5中的新增元素和废除元素
- 4.19
- Android开发-emulator-5554 disconnected异常解决方法
- C++ easyX画室内图
- 如何进行WebShpere MQ 运行故障的定位分析和排除
- Mac添加MySQL环境变量
- easyui的tab标签
- Xutils使用
- 著名Diffie-Hellman协议
- 我对速汇金业务的理解
- 《猜猜看》第一次发布
- Netty游戏服务器二
- Spring Security 安全框架
- Netty游戏服务器二
- 打算从今天开始,记录每一天的东西。
- Apache Maven 入门篇 ( 上 )
- struts2框架学习之国际化资源 (续)
- ORACLE