====================================
=======================================
void coin::get()
{
cin>>weight;
cin>>curr_X;
cin>>curr_Y;
}
void coin::print()
{
cout<<weight<<endl;
}
int coin::get_Curr_X()
{
return curr_X;
}
int coin::get_Curr_Y()
{
return curr_Y;
}
int coin::get_Weight()
{
return weight;
}
class black_Coin:public coin
{
int moves;
public:
void get()
{
coin::get();
cin>>moves;
}
void print()
{
coin::print();
}
void move()
{
cout<<curr_X<<","<<curr_Y+1;
}
int gained_Power()
{
if(moves>=5)
return 1;
else
return 0;
}
};
class red_Coin:public coin
{
public:
void get()
{
coin::get();
}
void print()
{
coin::print();
}
void move()
{
cout<<curr_X-1<<","<<curr_Y<<endl;
cout<<curr_X+1<<","<<curr_Y<<endl;
cout<<curr_X<<","<<curr_Y-1<<endl;
cout<<curr_X<<","<<curr_Y+1<<endl;
cout<<curr_X-1<<","<<curr_Y-1<<endl;
cout<<curr_X+1<<","<<curr_Y-1<<endl;
cout<<curr_X-1<<","<<curr_Y+1<<endl;
cout<<curr_X+1<<","<<curr_Y+1<<endl;
}
void set_Curr_Pos_Wt(black_Coin b)
{
weight=b.get_Weight();
curr_X=b.get_Curr_X();
curr_Y=b.get_Curr_Y();
}
};
=======================================
void coin::get()
{
cin>>weight;
cin>>curr_X;
cin>>curr_Y;
}
void coin::print()
{
cout<<weight<<endl;
}
int coin::get_Curr_X()
{
return curr_X;
}
int coin::get_Curr_Y()
{
return curr_Y;
}
int coin::get_Weight()
{
return weight;
}
class black_Coin:public coin
{
int moves;
public:
void get()
{
coin::get();
cin>>moves;
}
void print()
{
coin::print();
}
void move()
{
cout<<curr_X<<","<<curr_Y+1;
}
int gained_Power()
{
if(moves>=5)
return 1;
else
return 0;
}
};
class red_Coin:public coin
{
public:
void get()
{
coin::get();
}
void print()
{
coin::print();
}
void move()
{
cout<<curr_X-1<<","<<curr_Y<<endl;
cout<<curr_X+1<<","<<curr_Y<<endl;
cout<<curr_X<<","<<curr_Y-1<<endl;
cout<<curr_X<<","<<curr_Y+1<<endl;
cout<<curr_X-1<<","<<curr_Y-1<<endl;
cout<<curr_X+1<<","<<curr_Y-1<<endl;
cout<<curr_X-1<<","<<curr_Y+1<<endl;
cout<<curr_X+1<<","<<curr_Y+1<<endl;
}
void set_Curr_Pos_Wt(black_Coin b)
{
weight=b.get_Weight();
curr_X=b.get_Curr_X();
curr_Y=b.get_Curr_Y();
}
};