#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;
}
4.19
最新推荐文章于 2024-05-10 17:29:06 发布