如下所示,我设了小白和小黑两个人的攻防值以及一个攻击类函数
int WhiteStr = 10;
int BlackStr = 8;
int WhiteDef = 4;
int BlackDef = 5;
class Attack
{
public:
unsigned int Damage()
{
cout<<"造成"<<Str()-Def()<<"点伤害"<<endl;
}
private:
int Str(), Def();
protected:
};
心有法竹
饮歌长啸
慕运维8079593
相关分类