| 发表于: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(); } |
|
|
|
|