-
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
-
直接在内存运行PE
使用了PE加载技术、Hook技术用程序加载PE文件到内存并运行。当在内存中运行的程序,比如arp.EXE执行完之后就会退出,那结果是ExitProcess被调用,那将是我们主进程也结束,显然我们不希望这样。
处理办法:HOOK ExitProcess。问题来了,对MS的许多控制台程序,它们退出都是调用exit,所以如果HOOK ExitProcess, 那我们俩次在内存中运行arp.EXE之后就会死锁。所以对这类程序而言,不能H
OOK ExitProcess,只能HOOK msvcrt!exit。LOADER要加载一个EXE文件,这个EXE文件加载的地址是在0x400000。在我们LOADER的MAIN函数里面,这个地址已经被占用,而你是不能去Free这个地址
重新分布的,这样可能会导致程序崩溃,处理方法相见说明。
- 2022-01-21 18:51:40下载
- 积分:1
-
这是在MATLAB环境下进行电力系统暂态稳定分析的pst源程序,该文件定义了一个3机9节点的系统模型。...
这是在MATLAB环境下进行电力系统暂态稳定分析的pst源程序,该文件定义了一个3机9节点的系统模型。-This is the MATLAB environment in power system transient stability analysis of the pst source, the document defines a 3-machine 9-bus system model.
- 2022-01-25 20:29:38下载
- 积分:1
-
linux下QT编写的小游戏,适用于QT初学者对QT的基本编程的了解
linux下QT编写的小游戏,适用于QT初学者对QT的基本编程的了解-QT under linux written in a small game for QT on the QT for beginners to understand the basic programming
- 2022-12-11 05:30:03下载
- 积分:1
-
mega128的 书上的 电子时钟
mega128的 书上的 电子时钟-mega128 book electronic clock
- 2023-07-08 09:05:03下载
- 积分:1
-
floyd algorithm, can solve the graph theory of the person to the shortest distan
floyd算法,可以求解图论中人与两点之间的最短距离
- 2022-01-23 10:12:44下载
- 积分:1
-
用于计算李雅指数的混沌工具箱。
混沌Chaos工具箱,计算Lyapunov指数非常准确。-Chaos Chaos toolbox for calculating Lyapunov index very accurate.
- 2023-01-20 11:25:04下载
- 积分:1
-
library card procedures
图书馆借书证程序-library card procedures
- 2022-03-16 16:52:23下载
- 积分:1
-
Visual Studio 2005
几个网站控件的使用例子
Visual Studio 2005
几个网站控件的使用例子-Visual Studio 2005 website several examples of the use of control
- 2022-02-06 22:49:10下载
- 积分:1
-
EasyD12 dynamic link library is the Microsoft Windows interface standards, popul...
EasyD12动态连接库是Microsoft Windows的接口标准,流行的软件开发工具VC、VB、VF、Delphi、C++ Builder、Power Builder 等均可使用。用户可以选用自己喜爱的工具轻松搞定USB开发。其中包含2个版本DLL,根据情况自己选择。-EasyD12 dynamic link library is the Microsoft Windows interface standards, popular software development tools VC, VB, VF, Delphi, C Builder, Power Builder, etc. may be used. Users can choose their favorite tools easy to get USB development. Which contains two versions of DLL, according to the situation of their choice.
- 2022-11-19 09:25:03下载
- 积分:1