#include<iostream>
class book{
public:
book(int q,int p);
void book::showBook(book *p);
private:
int qu;
int price;
};
book::book(int q,int p)
{
qu=q;
price=p;
}
void book::showBook(book *p)
{
std::cout<<qu*price<<std::endl;
}
int main()
{
book bo[5]={
book(1,10),
book(2,20),
book(3,30),
book(4,40),
book(5,50),};
int i;
for(i=0;i<5;i++)
bo[i].showBook(bo);
system("pause");
return 0;
}
09-15
09-15