检索规则说明:AND代表“并且”;OR代表“或者”;NOT代表“不包含”;(注意必须大写,运算符两边需空一格)
检 索 范 例 :范例一: (K=图书馆学 OR K=情报学) AND A=范并思 范例二:J=计算机应用与软件 AND (U=C++ OR U=Basic) NOT M=Visual
机构地区:[1]解放军理工大学气象学院,江苏南京211101
出 处:《微型电脑应用》2010年第1期17-18,4,共2页Microcomputer Applications
摘 要:用3种不同的构造法可以生成奇阶、单偶阶和双偶阶三类不同的幻方。以全排列为基础,可以求出全部8个三阶幻方。为了求出全部四阶幻方,先找出1至16中和为34的四个数字组合,共有2064组。该文提出了两个求解全部四阶幻方的算法。算法一先确定一列,再确定4行。算法二先确定两列,再确定4行。四阶幻方共有7040个,其中880个无重复。算法二比算法一效率高得多,表明增加循环之前的检验之后,程序运行的速度大大提高了。Three different methods are used to structure three different kinds of magic squares in this paper: odd order, single-even order and doubly even order. Based on full permutation, All the third-order magic square are found, a total of 8. In order to get all the fourth-order magic square, firstly, identify the group containing 4 elements the sum of which is 34. There are 2064 such groups. This paper provides two algorithms to calculate all the fourth-order magic squares. Algorithm I first determine one column, and then determines the four ranks. Algorithm II first determines two columns, and then determines the four ranks. There are 7040 fourth-order magic squares, in which no-repeat of 880. Algorithm II is far more efficient than Algorithm I, which indicates that the increase of the checks before the cycles contributes to the promotion of the program’s operating speed.
分 类 号:TP301[自动化与计算机技术—计算机系统结构]
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在链接到云南高校图书馆文献保障联盟下载...
云南高校图书馆联盟文献共享服务平台 版权所有©
您的IP:3.141.107.132