0
点赞
收藏
分享

微信扫一扫

ZCMU OJ 1586 (1613) 卖玩具

三维控件研究 2022-04-14 阅读 50
c语言c++
#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;
} 

 

举报

相关推荐

oj 1001: ZCMU_A+B

ZCMU—A

ZCMU—1263

ZCMU—1374

ZCMU—1306

ZCMU—1798

ZCMU—1776

0 条评论