登录
首页 » 算法 » 素数环: 把从1到10这10个数摆成一个环,要求相邻的两个数的和是一个素数。 〖问题分析〗 这是一道回溯的题目。从1开始,每个空位有9种可能,每种可能加入约束...

素数环: 把从1到10这10个数摆成一个环,要求相邻的两个数的和是一个素数。 〖问题分析〗 这是一道回溯的题目。从1开始,每个空位有9种可能,每种可能加入约束...

于 2022-03-13 发布 文件大小:54.02 kB
0 134
下载积分: 2 下载次数: 1

代码说明:

素数环: 把从1到10这10个数摆成一个环,要求相邻的两个数的和是一个素数。 〖问题分析〗 这是一道回溯的题目。从1开始,每个空位有9种可能,每种可能加入约束条件即可 1.与前面所有的数不重复 2.与前一个数和为素数(最后一个和第一个也要满足)。 〖算法流程〗 1、数据初始化; 2、递归填数: 判断第J种可能是否合法; A、如果合法:填数;判断是否到达目标(10个已填完): 是,打印结果;不是,递归填下一个; B、如果不合法:选择下一种可能;-Prime Central: 1-10 from 10 the number of put this into a ring, asked the two adjacent numbers and is a prime number. 〗 〖Analysis is a retrospective this topic. From 1 year, 9 out of every space possible, each may be bound by the conditions of accession to 1. And in front of all the number of non-repetition, 2. With a few and for a prime number (the last and the first to meet). 1〗 〖algorithm processes the data to initialize 2, fill in the number of recursion: first to determine the legality of J possible A, if the legitimate: the number of Reclamation to determine whether the target (10 have been completed): Yes, print the results of not, fill in the next recursive B, if not legitimate: a possible alternative

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

发表评论

0 个回复

  • 字符串匹配 KMP
    包含main()函数,KMP()以及GetNext()函数。VS2010编译通过。
    2022-02-28 21:09:56下载
    积分:1
  • MD5加密
    MD5以512位分组来处理输入的信息,且每一分组又被划分为16个32位子分组,经过了一系列的处理后,算法的输出由四个32位分组组成,将这四个32位分组级联后将生成一个128位散列值。MD5中有四个32位被称作链接变量(Chaining Variable)的整数参数,他们分别为:A=0x67452301,B=0xefcdab89,C=0x98badcfe,D=0x10325476。当设置好这四个链接变量后,就开始进入算法的四轮循环运算。循环的次数是信息中512位信息分组的数目。
    2022-03-21 16:38:05下载
    积分:1
  • kalman滤波的白球跟踪
    基于卡尔曼滤波的白球跟踪程序,白球为运动球,绿球为基于kalman滤波跟踪的球,红球为观测球,对kalman的理解有较好的帮助
    2022-03-13 18:17:09下载
    积分:1
  • Fourier Transforms WAPAPI FFT function, display waveforms and sound very good
    FFT傅立叶转换 WAPAPI 函数, 显示波形和声音, 非常不错的-Fourier Transforms WAPAPI FFT function, display waveforms and sound very good
    2022-03-10 04:14:01下载
    积分:1
  • 有届面的BP软件.操作简单,画面华丽,适用于本科生毕业用...
    有届面的BP算法软件.操作简单,画面华丽,适用于本科生毕业用-Session has the software side of BP algorithm. Simple, gorgeous screen, applies to undergraduate students graduate with
    2022-01-26 05:31:43下载
    积分:1
  • 复杂网络最短路径,详细而有条理,很有帮助
    复杂网络最短路径算法,详细而有条理,很有帮助-Complex network shortest path algorithm, detailed and structured, very helpful
    2023-07-24 18:00:03下载
    积分:1
  • 穷举程序
    穷举法程序-算法分析,是用C写的好经典,马克思手稿…………有三个程序! -Exhaustive method process- algorithm analysis, is to use C to write a good classic, Marx manuscripts ... ... ... ... There are three procedures!
    2023-06-25 11:05:03下载
    积分:1
  • curve fitting code, based on minimize the variances values.
    更具 聂翔 教授写的 最小二乘法 在曲线拟合中的实现,写成的code,编译通过。-curve fitting code, based on minimize the variances values.
    2022-04-07 09:33:45下载
    积分:1
  • 快速傅立叶变换,及快速傅立叶反变换。输入第一行为向量维数,第二三行为两个向量...
    快速傅立叶变换,及快速傅立叶反变换。输入第一行为向量维数,第二三行为两个向量-Fast Fourier Transform, and Fast Fourier Transform. Input vector dimension of the first acts, acts of two vector
    2023-06-17 14:30:03下载
    积分:1
  • C程序贝塞尔解
    贝塞尔大地问题解算,C程序……包括了贝塞尔大地问题的正算和反算,并且其中有一个自己编写的.h的文件,这个问价能够简化程序……事先准备了一组正确数据来验证程序正确性,如果需要计算其他结果,则修改TXT文件中数据即可。
    2023-03-11 22:10:04下载
    积分:1
  • 696518资源总数
  • 105873会员总数
  • 12今日下载