ZCMU OJ 1586 (1613) 卖玩具

阅读 50

2022-04-14

#include<iostream>
using namespace std;
class Toy
{
    public:
        void setToy(int m,int n)
        {
            price=m;
            count=n;
            total=m*n;
        }
        void showToy()
        {
            cout<<"Price="<<price<<",Count="<<count<<",Total="<<total<<endl;
        }
    private:
        int price;
        int count;
        int total;
};
int main()
{
    int m,n;
    while(cin>>m>>n){
        Toy a;
        a.setToy(m,n);
        a.showToy();
    }
    return 0;
} 

 

精彩评论(0)

0 0 举报