标题: 一个来自国外的C语言程序题目 [打印本页] 作者: guolinfire 时间: 2006-6-3 22:01 标题: 一个来自国外的C语言程序题目 You are to prepare a C programe that accepts one line argument.This argument will be the name of a file containing a maze.For explorer,if the name of your compiled program is a.out and the name of the maze fileis mazel then you would run the program as follows.
The maze file is a text file made up of spaces #'s plus one "s"and one"f",representing the start and finish of the maze.For the maze to be well formed it must meet the following requirements.
1.The start and finish must be surrounded by an unbroken perimeter of #"s
2.After the final # in each line of the maze the next character is a newline.
3.There are no spaces tithin the maze that cannot be reached by moving down one of the maze paths.
The following points can also be noted about the mazes
1.The maze can be any width and length and as you can see,does not have to be rectangular.
2.When moving in the maze you may only move up and down and right and left.You may not move diagonally.