搜索资源列表
Euler_fuction
- Euler函数: m = p1^r1 * p2^r2 * …… * pn^rn ai >= 1 , 1 <= i <= n Euler函数: 定义:phi(m) 表示小于等于m并且与m互质的正整数的个数。 phi(m) = p1^(r1-1)*(p1-1) * p2^(r2-1)*(p2-1) * …… * pn^(rn-1)*(pn-1) = m*(1 - 1/p1)*(1 - 1/p2)*……*(1 - 1/pn)
prog1
- 在一定数的范围内返回素数!二级必会!其中运用到循环结构-At a certain range of the number of prime numbers back! 2 must be! Applied to one of the cycle structure
ss
- 检测素数,就是看看是不是素数,没别的。够数了吧?-Prime Number
2
- 编写筛选查找素数函数: 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
qiusushu2
- 这个程序较前者1,有些更改,是将一些素数先求出来存入数组备用。所以当所求范围较大如间隔为200万,500万,时若使用该程序可比qiusushu1节约1---2分钟-This procedure than the former one, and some change is to first seek out a number of prime numbers into an array of backup. So when not asked for a wider range such as
wrwsoft
- 可以指定某个随机数,生成任意小于该数的所有素数,-failed to translate
Eratoshenes
- eratoshenes素数筛选,本源码是通过标记数组下标来记录1000以内的质数-eratoshenes prime filter, the source is through the tag array subscr ipt to record prime number those are less than 1000
main
- 回文素数(回文数——从左到右和从右到左是看一样的;素数——指在一个大于1的自然数中,除了1和此整数自身外,没法被其他自然数整除的数。) -Prime Palindromes(The number 151 is a prime palindrome because it is both a prime number and a palindrome (it is the same number when read forward as backward). Write a program
2(CPP-ver)
- 验证12位二进制数是否为素数,利用素性检测方法实现-Verify 12-bit binary number of prime numbers, primality testing methods
eg1
- 提示用户输入一个数据总个数(设定一个范围,如果用户是非法输入,应可以提示重输) 提示给这个数组输入整数值(如果用户输入错误,应可以重输) 显示未排序数组的元素 询问是否要在未排序数组中查找数据(如果你选择的不是Y,y,程序将从第八步开始) 提示输入一个查找值 显示查找结果(如果程序发现一个匹配的元素,它就显示此元素数组的下标,否则程序靠诉你没有找到与查找值匹配的元素) 重复执行第4步 显示已排序数组的元素 询问是否要在排序后的数组中查找数据(如果你选择的不是Y,y
Sushushengcheng
- 素数生成 任意素数生成 效率高 控制台win32下 数组枚举rand-Prime number generation efficiency of any prime number generation console win32 array enumeration rand
C-language-and-a-classic-code
- 该资源有28个经典的C语言代码,包括两数交换、考试成绩转换成等级分、判读闰年、求平均、求最大值、求最小值、统计个数、最大公约数、求 n 的阶乘、打印九九乘法表、求 100 以内的素数、求水仙花数、用函数求 x 的 n 次幂-28 classic C language code of the resource, including the exchange of two numbers, test scores convert level interpretation of the leap ye
12
- 有一个正整数数组,包含N个元素,要求编程求出其中的素数之和以及所有素数的平均值。-A positive integer array containing N elements, programming to find the primes and the average of all primes.
Seeking-primes-
- 如果从2-30中的素数,然后将筛中的最小数2作为素数,并把2的倍数都 从筛中取走。这样,第一步以后,筛子中还剩下2和2-30所有奇数。重复上述步骤,在筛中保留的数中保留的数中即将小数3作为素数,并从筛中取走3的倍数。反复重复上述步骤,直到筛听素数7大于30的平方根结束。-Primes from 2-30, and then sieve the minimum number of 2 as a prime number, and the multiple of 2 are removed from
L12_7
- 课后习题,包括完数的计算,素数计算,猴子吃桃问题等。-Homework finished the calculation of the number of primes monkeys eat the peach problems.
mersenne_final
- 证明p=89、107、127、521、607、1279时Mp=2p-1是Mersenne素数,并打印出这些数的所有位数(It is proved that when p=89, 107, 127, 521, 607, 1279, Mp=2p-1 is the prime number of Mersenne, and all the digits of these numbers are printed ou)
字符串综合
- 素数对 统计单词数 反正很简单也很容易学 信息竞赛入门水题(A prime number is simple to count the number of words, and it's easy to learn the entry of information competition.)
常用函数
- 用筛法求素数的基本思想是:把从1开始的、某一范围内的正整数从小到大顺序排列, 1不是素数,首先把它筛掉。剩下的数中选择最小的数是素数,然后去掉它的倍数。依次类推,直到筛子为空时结束。如有: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 1不是素数,去掉。剩下的数中2最小,是素数,去掉2的倍数,余下的数是: 3 5 7 9 11 13 15 17 19 21 23 25 2
判断素数
- 判断101-200之间有多少个素数,并输出所有素数。 1.程序分析:判断素数的方法:用一个数分别去除2到sqrt(这个数),如果能被整除, 则表明此数不是素数,反之是素数。(Determine how many primes are there between 101-200 and output all the prime numbers. 1. program analysis: the method of judging the prime number: 2 t
可逆素数
- 输入一个数判断该数是否是一个可逆素数,如果是输出**是可逆素数,否则为不是!(Enter a number to determine if the number is a reversible prime number. If it is output * is a reversible prime number, otherwise it is not!)