Home > Net >  How to use c # language in the list to print the number of pair of prime Numbers
How to use c # language in the list to print the number of pair of prime Numbers

Time:09-25

Of new sigh agghh for help

CodePudding user response:


演示您可以将有关算法的信息和伪代码转换为C#码,还有一些棘手的循环限制需要处理,注意:您可以从模板开始提供,但最终代码必须遵循样式指南,前两个部分涉及素数数字,质数(或素数)是大于1的自然数,没有正数除1本身以外的除数,质数可以使用Eratosthenes,可以在链接上找到有关此算法的信息,包括伪代码,下面,尽管这很有趣,但是您不应成为数学专家,但是,您将不得不将伪代码转换为C#, https://cp-algorithm.com/algebra/sieve-of-eratosthenes.html,使用Visual Studio进行代码,输入将是闭合间隔[0,kN]中的整数,其中kN将不超过10000,Eratosthenes算法,确定[0,kN]中的素数以及素数和最大素数以下是kN=20的示例输出,输入kN:2 3 5 7 11 13 17 19#Prime:8,Max_prime:191)确定找到的素数之间的平均差(大减小),您可能想组成素数的数组–这是处理素数的一种方法, kN=20的示例输入kN:2 3 5 7 11 13 17 19#Prime:8,Max_prime:19平均差异:22)在列表中打印双素数对的数量,作为兴趣点,您可能想要检查孪生素数猜想,也许你可以证明这一点,下方链接,https://www.britannica.com/science/twin-prime-conjecture3)将实际素数放在素数[0]到素数之间的数组中,[#primes-1]按数字顺序,遍历数组素数,如果数字在单位的位置在素数[i + 1]的单位位置中放置素数[i]> Digits, then exchange of two Prime Numbers of these Prime location, 19 and 23 exchange, for example, from a + 1 bonus to [I] to continue to the end, the output of the modified Prime number array, 4) exchange changes the position of the two maximum values of the Prime Numbers, in order to get full credit, you must be tracked to perform any previous tasks these values, which you can not add any array output in addition to the new changes of the loop, other than a Prime number array of new output modified Prime, the following is a kN=55 sample output, input kN: 552 3 5 7 11 of 13 17 and 23 29 31 37 41 43 # 47 and 53 Prime: 16, Max_prime: 53 average differences: 3 # pair of Prime Numbers: 62 3 5 November 13 July 17 23 19 31 37 41 43 47 and 53 292 3 5 November 13

CodePudding user response:

I don't understand agghh

CodePudding user response:

For a great god, and give a warm sigh

CodePudding user response:

Prime is endless, you want to give a limit,
Or do you want to give statistical frequency? The proportion of pair of prime Numbers between ten million to twenty million? To the proportion of the pairs of prime Numbers between 1020 million on 1010 million?

Questions of good, easy to get a good answer,

CodePudding user response:

reference 4 floor github_36000833 response:
prime is endless, you want to give a limit,
Or do you want to give statistical frequency? The proportion of pair of prime Numbers between ten million to twenty million? To the proportion of the pairs of prime Numbers between 1020 million on 1010 million?

Questions of good, easy to get good answers,

The scope of his input
I want to know how to use c # language in the list of double the number of primes of printing method

CodePudding user response:

求助

CodePudding user response:

For you to do my homework is counterproductive,
Encourage you to yourself, the difficulties encountered in the process of, again to seek help,
  •  Tags:  
  • C #
  • Related