您的位置:程序门 -> c/c++ -> c++ 语言



急!!!迷宫问题


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


急!!!迷宫问题
发表于:2007-04-09 16:58:05 楼主
求迷宫算法!二维动态数组,用栈的方法,路径要以**表示,没有路径要输出no   answer.要用intput输入,output输出,其格式为
#include <iostream.h>
#include <fstream.h>
#include   <time.h>
#include <math.h>

clock_t   start;
void   main()                
{                                    
        start=clock();
int   a;
ifstream   fin( "input.txt ",ios::in);
        if(!fin)
cout < < "can 't   open   file   " < <endl;
ofstream   fout( "output.txt ",ios::out);
        fin> > a;
fout < <a;
 

        cout < <clock()-start;                                         //计算程序运行时
fin.close();
fout.close();
}
发表于:2007-04-09 17:44:591楼 得分:0
一半采用a-star算法。
这个很简单,就是依靠权值去遍历,逐渐逼近终点
发表于:2007-04-09 17:54:082楼 得分:0
up
ls   zhengjie
发表于:2007-04-09 18:32:503楼 得分:0
nehe.gamedev.net
    http://nehe.gamedev.net/data/downloads/download.asp?letter=f    
    http://nehe.gamedev.net/data/downloads/download.asp?letter=g
发表于:2007-04-09 21:39:154楼 得分:0
那网址什么意思呢


快速检索

最新资讯
热门点击