#include<iostream>
using namespace std;
class role
{
public:
void setrole(string m_name,int m_blood)
{
name=m_name;
blood=m_blood;
}
void show()
{
cout<<name <<" has "<< blood<<" blood"<<",";
if(blood>0)
cout<<"it is alived"<<endl;
else
cout<<"it is dead"<<endl;
// if(life)
// cout<<"it is alived"<<endl;
// else
// cout<<"it is dead"<<endl;
}
void attack(int y)
{
blood=blood+y;
}
void beattack(int x)
{
blood=blood-x;
}
void eat (int m_blood)
{
blood+=m_blood;
}
private:
string name;
int blood;
bool life;
};
int main()
{
role tom;
tom.setrole("tom",4);
tom.show();
tom.attack(2);
tom.eat(4);
tom.beattack(2);
tom.show();
return 0;
}