資源簡介
代碼片段和文件信息
#include
#include
using?namespace?std;
class?qipan
{
public:
?qipan()?{}
?~qipan()?{};
?//向上下左右,斜的方向
?char?left(int?x?int?y)
?{//檢查是否合適
?if?(x?>=?1?&&?x?<=?hight&&?y?-?1?>=?1?&&?y?-?1?<=?width)
?{
??return?q[x][y?-?1];
?}
?else?{
??return?‘F‘;
?}
?}
?char?right(int?x?int?y)
?{
?if?(x?>=?1?&&?x?<=?hight&&y?+?1?>=?1?&&?y?+?1?<=?width)
?{
??return?q[x][y?+?1];
?}
?else?{
??return?‘F‘;
?}
?}
?char?up(int?x?int?y)
?{
?if?(x?-?1?>=?1?&&?x?-?1?<=?hight?&&?y?>=?1?&&?y?<=?width)
?{
??return?q[x?-?1][y];
?}
?else?{
??return?‘F‘;
?}
?}
?char?down(int?x?int?y)
?{
?if?(x?+?1?>=?1?&&?x?+?1?<=?hight?&&?y?>=?1?&&?y?<=?width)
?{
??return?q[x?+?1][y];
?}
?else?{
??return?‘F‘;
?}
?}
?char?left_up(int?x?int?y)
?{
?if?(x?-?
- 上一篇:DXFRead 讀寫CAD的
- 下一篇:c++ 顯示系統時鐘的小程序源碼
評論
共有 條評論