4.19
2015-06-04 00:09
323 查看
#include<iostream> using namespace std; class book { private: int qu; int price; public: book(int q,int p) { qu=q; price=p; } void print() { cout<<qu*price<<endl; } }; int main() { book b[5]={book(1,10),book(2,20),book(3,30),book(4,40),book(5,50)}; for(int i=0;i<5;i++) b[i].print(); return 0; }
相关文章推荐
- 熟悉Windows XP系统
- Android的Style的使用
- Android的Style的使用
- int --string
- 二分法排序(折半插入排序)
- .bash_profile和.bashrc的区别(如何设置生效)
- JDK,JRE & JVM
- ubuntu14.04加入win7引导
- 获取字体的高度和宽度
- Reflector 反编译 .NET文件后修复
- android:background="@color/white" [create file color.xml at res/values/]
- android:background="@color/white" [create file color.xml at res/values/]
- 前端性能优化最佳实践
- spring开源项目链接
- 查找——图文翔解Treap(树堆)
- android布局属性详解
- Java中利用gson解析Json实例教程
- python在windows下创建隐藏窗口子进程的方法
- Python使用multiprocessing创建进程的方法
- Python守护进程用法实例分析