/*
*copyright(c) 2016,烟台大学计算机学院
*All rights reserved
*文件名称:test.cpp
*作者:李旭
*版本:v6.0
*
*问题描述:游戏角色
*输入描述:无
*程序输出:输出答案
*/
#include <iostream>
using namespace std;
class Role
{
public:
……
private:
string name;
int blood;
bool life;
};
int main( )
{
Role mary;
mary.setRole("Mary", 4);
mary.show();
mary.attack();
mary.eat(2);
mary.beAttack();
mary.beAttack();
mary.show();
return 0;
}
*copyright(c) 2016,烟台大学计算机学院
*All rights reserved
*文件名称:test.cpp
*作者:李旭
*版本:v6.0
*
*问题描述:游戏角色
*输入描述:无
*程序输出:输出答案
*/
#include <iostream>
using namespace std;
class Role
{
public:
……
private:
string name;
int blood;
bool life;
};
int main( )
{
Role mary;
mary.setRole("Mary", 4);
mary.show();
mary.attack();
mary.eat(2);
mary.beAttack();
mary.beAttack();
mary.show();
return 0;
}