In order to realize recursive computation and break through programming trouble of absence of dynamic array in pascal. the computation method using query and the file system of pascal language are used in the program so that to store middle data and last results in it. 为实现递归计算,突破无动态数组的编程障碍,程序使用查询计算方法,并采用PASCAL语言文件系统存放中间数据和最后结果。