⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.cpp

📁 用矩阵表示的迷宫
💻 CPP
字号:
#include "main.h"
void main()
{
	srand(time(NULL));
	int size = 35;
	int**a = new int*[size];
	for(int i = 0;i<size;i++)
	{
		a[i] = new int[size];
		for(int j = 0;j<size;j++)
		{
			int t = rand()%3;
			if(t == 1)a[i][j] = 1;
			else a[i][j] = 0;
		}
	}
	ofstream out;
	out.open("maze.txt");
	
	Maze n(a,size);
	cout<<n;
	out<<n;
	//n.OutPutPath(cout);
	n.OutPutPath(out);
	Maze m(a,size,0);
	//m.OutPutPath(cout);
	m.OutPutPath(out);
	out.close();
	for(int i = 0;i<size;i++)
		delete[]a[i];
	delete[]a;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -