?? main.cpp
字號:
#include "stdafx.h"
#include "stdio.h"
#include "stack.h"
#include "mazepath.h"
/*
#define RANGE 10 //設置數組的最大長度
typedef int DirectType;
typedef struct {
int r,c; //迷宮中r行c列的位置
}PosType;
typedef struct {
int row,col;
char arr[RANGE][RANGE];//各位置取值' ','#','@'或'*'
}MazeType;
typedef struct {
int step; //當前位置在路徑上的“序號”
PosType seat; //當前的坐標位置
DirectType di; //往下一坐標位置的方向
}ElemType; //棧的元素類型
typedef struct NodeType {
ElemType data;
struct NodeType *next;
}NodeType,*LinkType; //結點類型,指針類型
typedef struct {
LinkType top;
int size;
}Stack; //棧類型
*/
void main(){
char cmd;int m;
MazeType Maze;
PosType start,end;
Initialization();
cmd=getchar();
while(cmd!='q'&&cmd!='Q'){
switch(cmd){
case'c':
case'C':CreateMaze(Maze);break;
case'm':
case'M':printf("輸入起始位置的行列值\n");scanf("%d%d",&start.r,&start.c);
printf("輸入結束位置的行列值\n");scanf("%d%d",&start.r,&start.c);
m=MazePath(Maze,start,end);break;
case'p':
case'P':if(m)PrintMaze(Maze);
}
fflush();
cmd=getchar();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -