登录
首页 » 算法 » 蓝桥杯-六角幻方-代码

蓝桥杯-六角幻方-代码

于 2022-02-07 发布 文件大小:943.55 kB
0 168
下载积分: 2 下载次数: 1

代码说明:

应用背景 这是蓝桥杯往年的一个题目,类似的题目有六角填数、4*4魔方阵等。题目如下图: 将1,2,3,...19填进去,图中已经填了两个数15和13,填完后要求每条直线上的数字之和相等,图中共有十五条直线。 关键技术代码在VS2010上运行。 设和为a, 则a*15/3=(1+19)/2*19  所以 a=38 前两个数已经填好,开始填第三个数,将满足vis=0的数依次填进去。填完第三个数,第一行已经形成了直线,判断第一行的和是不是38. 填完第七个数,新增加了一条直线(第二行),判断它的和。填完第八个数,增加了一条线(45°方向),判断其和。以此类推。程序关键是:每填完一个数,看有没有新增加的直线,并判断数字和,不能全部填完19个数再判断,因为计算量太大,程序运行不出来。

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 浮点转换器,可以对十进制定点数、浮点BCD码和二进制浮点操作数之间进行相互转换。...
    浮点转换器,可以对十进制定点数、浮点BCD码和二进制浮点操作数之间进行相互转换。-float converters, and can set the decimal points. BCD floating-point and binary floating-point operation between several mutual conversion.
    2023-06-13 08:20:04下载
    积分:1
  • 迷宫生成及搜索,一些好的,分享给大家
    迷宫生成及搜索算法,一些好的算法,分享给大家-maze generation and search algorithm, some good algorithm, we share
    2022-06-19 21:56:39下载
    积分:1
  • matrix eigenvalue of the largest power France. For engineering calculation, Matr...
    矩阵的最大特征值的幂法. 对于工程计算而言,矩阵的特征值和特征向量都是相当重要和常见的数据,这里给出的幂法是一种常见的求解方法,用的是迭代的思想。 符号说明: 1A为待求的矩阵, 2Uk,Vk为迭代用的列向量。 3最后的最大特征值maxLamda由最后一次的max(Uk)-----求Uk中的绝对值最大的元素的绝对值.所决定。 而maxLamda所对应的特征向量由最后一次迭代的Vk所决定. 主要的想法就是先选一个不为0的初始向量U0!=0,然后按下面的式子迭代。 -matrix eigenvalue of the largest power France. For engineering calculation, Matrix eigenvalues and eigenvectors are very important and common data, here is the power law is a common solution, using the iterative thinking. Symbol : 1A of the question for the matrix, 2Uk, Vk iteration of the column vector. The final three largest eigenvalue maxLamda from last max (uk Hoffmann for the uk the largest absolute value of the absolute value of the element. by decision. While maxLamda corresponding eigenvectors from the last iteration of Vk decision. The main idea was first choice not one of the initial vector 0 U0! = 0, then by the following formula iteration.
    2022-12-15 11:10:03下载
    积分:1
  • C和指针课后答案代码
    应用背景阅读c和指针时,初学者都会被一些疑问所困扰,我将一些亲测可用的问题答案代码放上来了。关键技术包含代码较全,比课后答案附录要全
    2022-07-15 21:19:04下载
    积分:1
  • 读取segy的程序
    是一个读取segy的程序。需要一个输入的par文件来描述观测系统。结果输入为地震数据。
    2022-10-28 01:10:04下载
    积分:1
  • matrix calculation includes all the header files and can be applied to all the n...
    包含所有矩阵运算的头文件,可以应用在所有需要矩阵运算的VC程序中,-matrix calculation includes all the header files and can be applied to all the needs of the VC matrix calculation procedures,
    2023-04-20 07:35:04下载
    积分:1
  • 伸展树
    伸展树的一系列操作代码实现,
    2023-08-28 04:00:03下载
    积分:1
  • establish a ranking Binary Tree
    建立一个排序二叉树-establish a ranking Binary Tree
    2022-01-25 14:31:04下载
    积分:1
  • In the basic role of half
    在基础半正弦冲击作用下,硬特性刚度系统的冲击动态响应计算-In the basic role of half-sine shock, the hardware characteristics of stiffness of the system dynamic response calculation of the impact
    2022-05-14 04:21:07下载
    积分:1
  • 各种排序的C++实现
    应用背景排序是数据结构学习中非常重要的一个部分,也是各大公司面试笔试必须考试的内容,如果你想学习排序,并且希望用C++语言实现的话,本程序将是你的不二选择,这里面实现了初级冒泡排序,冒泡排序,改进冒泡排序,选择排序,直接插入排序,希尔排序,堆排序,归并排序(递归)。关键技术这里面实现了初级冒泡排序,冒泡排序,改进冒泡排序,选择排序,直接插入排序,希尔排序,堆排序,归并排序(递归)。里面包括链表的创建,链表的删除,链表的合并,数据的交换,堆的定义,调整大顶堆,调整小顶堆和结构体的定义等重要技术。
    2022-09-08 12:00:03下载
    积分:1
  • 696518资源总数
  • 106155会员总数
  • 8今日下载