class enemy{
protected:
int attackpower;
public:
void setattackpower(int a){
attackpower=a;
}
};
class ninja: public enemy{
public:
void attack(){
{cout << "i am a ninja -" << attackpower << endl;}
};
class monster: public enemy{
public:
void attack()
{cout << "i am a monster -" << attackpower << endl;}
};
};
int main(){
ninja n;
monster m;
enemy *enemy1 = &n;
enemy *enmey2 = &m;
enemy->setattackpower(10);
enemy2->setattackpower(15);
n.attack()
m.attack()
return 0;
}