题目简要描述:
输入一个二维结构体,以及给定一个点击的位置,编写代码返回所选区域的边缘,包括本身。
#include <iostream>
#include <vector>
using namespace std;
enum{
LEFT = 1, RIGHT = (1 << 1), TOP = (1 << 2), BOTTOM = (1 << 3), LEFT_TOP = (LEFT|TOP), RIGHT_TOP=(RIGHT|TOP), LEFT_BOTTOM=(LEFT|BOTTOM), RIGHT_BOTTOM=(RIGHT|BOTTOM)};
int DIRECTIONS[8] = {
LEFT, RIGHT, TOP, BOTTOM, LEFT_TOP, RIGHT_TOP, LEFT_BOTTOM, RIGHT_BOTTOM};
struct Point{
int X;
int Y;
};
class Cell
{
private:
int row;
int column;
int direction;
bool exists;
public