-
Find prime numbers prepared by screening the function: void sieve (bool isPrime...
编写筛选查找素数函数:
void sieve(bool isPrime[], int n)
其中isPrime[ ]为一个布尔型数组,n为数组大小。由于2是第一个素数,
所以设置isPrime[0]和isPrime[1]的值为false,并设置其余的元素初值为true。
然后对从4到n-1的每一个i,判断i是否能够被2整除,如果i能够被2整除,则设置isPrime[i]为false。
对从2到n/2的每一个可能的数值重复以上处理,当操作结束时,所有值为true的isPrime[i]所对应的i就是素数,它们将是从筛子中掉下来的。-Find prime numbers prepared by screening the function: void sieve (bool isPrime [], int n) which isPrime [] as a Boolean array, n is the size of the array. Because 2 is the first prime number, so set the isPrime [0], and isPrime [1] a value of false, and set the initial value of the remaining elements of true. And then from 4 to n-1 for each i, to determine whether i can be divisible by 2, if i can be divisible by 2, then set the isPrime [i] is false. From 2 to n/2 possible values for each one to repeat the above processing, when the operation ended, all the true value of the isPrime [i] corresponding to i is a prime number, they will be falling from the sieve in the past.
- 2023-03-02 04:45:03下载
- 积分:1
-
在Linux/Unix平台下,用C语言编写一个进程通信的程序,理解fork()等一些系列系统函数的正确使用和工作原理,学会设计基本的进程通信程序。...
在Linux/Unix平台下,用C语言编写一个进程通信的程序,理解fork()等一些系列系统函数的正确使用和工作原理,学会设计基本的进程通信程序。-in Linux/Unix platform using C language of a process of communication procedures, understanding fork () and some other family functions and the use of the correct principle, learn the basic process design communication program.
- 2022-04-08 09:22:57下载
- 积分:1
-
可以满足一般的b/s数据录入功能,ajax构建的
可以满足一般的b/s数据录入功能,ajax构建的-meet general b/s data entry functions, the ajax Construction
- 2022-04-28 16:50:30下载
- 积分:1
-
ASP
asp-net项目开发实例-asp-net project development Example
- 2022-05-15 16:42:40下载
- 积分:1
-
本程序是一个有关屏幕鼠标跟随的小设计。从前曾用过许多Windows桌面主题,其中有关鼠标跟随非常单调,无法体现个人风格。不久前发现一个很有趣的小程序――TopC...
本程序是一个有关屏幕鼠标跟随的小设计。从前曾用过许多Windows桌面主题,其中有关鼠标跟随非常单调,无法体现个人风格。不久前发现一个很有趣的小程序――TopCat,启动后Cat可以跟随鼠标的运动作出不同的动作(该程序在文件夹《下载原始版》中)-this program is a mouse on the screen with a small design. Many used to secure Windows desktop theme, the mouse with a very monotonous and not be able to demonstrate personal style. Not long ago found a very interesting small programs-- TopCat, after commencement Cat can follow the movement of the mouse to make different movements (in the program folder "download the original version")
- 2022-06-19 14:27:47下载
- 积分:1
-
本程序采用牛顿拉夫逊进行电力网络的潮流分布计算,是电力系统教学的工具之一。...
本程序采用牛顿拉夫逊进行电力网络的潮流分布计算,是电力系统教学的工具之一。-This procedure using the Newton Raphson power networks, the trend of distributed computing, power systems are one of the tools of teaching.
- 2022-11-01 17:50:03下载
- 积分:1
-
数字锁相源的核心,它是一个很好的
Dpll source core ,it is very good for some one-Dpll source core,it is very good for some one
- 2022-12-16 04:20:03下载
- 积分:1
-
php use the skills for the development of procedures with PHP helpful
php使用的技巧,对于用PHP开发程序很有帮助-php use the skills for the development of procedures with PHP helpful
- 2023-02-13 01:55:03下载
- 积分:1
-
用C语言写的YABasic解释器,可以在Linux/windows等多个平台上运行...
用C语言写的YABasic解释器,可以在Linux/windows等多个平台上运行-C YABasic written language interpreter, the Linux/windows etc. running on multiple platforms
- 2022-07-20 18:22:07下载
- 积分:1
-
机动目标的机动不确定。机动频率我..
在机动目标跟踪中,机动目标模型是机动目标跟踪的基本要素之一,一般希望机动目标模型能准确表征目标机动时的各种运动状态。比较常用的模型有匀速运动(CV)模型、匀加速运动(CA) 模型、时间相关模型(Singer)和机动目标“当前”统计模型。上述模型均采用机动频率表征目标的机动情况。在应用当中,通常采用固定的机动频率,这就表示机动目标的机动时间是一定的,而实际上机动目标的机动时间是不断变化的,也就是说机动频率是不断变化的,采用固定机动频率必然会带来误差。采样周期在0.5―2S时,机动频率越小跟踪精度越高[1],但机动频率仍然是固定值。本文提出的基于神经网络的机动频率自适应调整方法可以使机动频率随机动而变化,从而提高状态估计的准确性,提高跟踪精度。本文将小波神经网络用于机动目标跟踪中机动频率的自适应调整,该算法对机动目标“当前”统计模型中的机动频率进行实时修改, 从而自适应的改变机动频率,使跟踪算法与目标的真实状态更接近。该算法采用小波神经网络的离线训练,实时性好。-The maneuver of the maneuvering target is uncertain. The maneuvering frequency is constantly changeable, but traditionally it is beforehand determined as a constant based on the target state estimation in the state model of the maneuvering target. The maneuver of the maneuvering target makes the kinematics equation of the target model mismatch with the practical motion model and the tracking error will be increased. Based on the advantages of the self-learning, the rapid convergence rate and the nonlinear approximation ability of the wavelet neural network,
- 2022-10-19 14:20:03下载
- 积分:1