#include<iostream>
#include<string>
using namespace std;
class book
{
public:
book(int a)
{ qu=a;
price=10*a;
}
void show()
{
cout<<qu*price<<endl;
}
private:
int qu;
int price;
};
int main()
{
book book1[5]={book(1),book(2),book(3),book(4),book(5)};
int i;
book* p=book1;
for( i=1;i<=4;i++)
{
p[4-i].show();
}
return 0;
}
作业4.20
最新推荐文章于 2021-03-02 02:30:33 发布