查找素数的简单算法 [英] simple algorithm for finding primes

查看:70
本文介绍了查找素数的简单算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好


我是这群人的新手。如果我违反任何规则我会道歉。


我写了一个简单的程序来查找前1,000,000个素数,并找到

所有素数范围(高达200 * 10 ^ 12)


它非常高效,计算前1,000,000

素数需要15分钟。 />

我想在这里你的意见


ps我不是数学家,事实上,我的数学水平是小学

(几乎没有)。


请Cc全部回复 ae **** @ arach.net.au


用(hrneo)替换aesqq在@之前,


谢谢


迈克尔


//编译器:ms visual c ++ 7.0


#include< stdio.h>


#include< conio.h>


#include< math.h>


int main()


{


很久,暂停;


// ************收集用户的信息**************


printf(&\\; *** ***欢迎*** \这个程序显示所有素数高达约

$ 20亿美元输出过程占用了大量资源,如果你希望
显示大数字,建议你设置Nth prime为

大于100);


printf(" \ n \\ n \\ n \\ n请输入要显示的第N个prine,如果选择10,将显示第10个,第20个,第30个...... b ...将显示质数。\ n \\ nnn选择一个数字

在1和10,000之间,或0到退出\ n");


fflush(stdin);


scanf( %d,& nth);


if(!nth)返回0;


printf(请输入后多么多的数字暂停。请选择一个数字

介于2和10,000之间\ nn);


fflush(stdin);


scanf(%d,&暂停);


// ************结束收集用户的信息***** *********


//创建并存储前5000个素数:


long * prime = new long [1000000]; long counter = 3; bool flag = 1;


prime [0] = 1; prime [1] = 2; prime [2] = 3; //设置前三个素数


printf(" \ n \ nn \ t \ t --- finished\\\
\ n"); getch();


//我是要检查的数字,如果它是素数


//循环i = 5最初,添加2到i evey循环,如果计数器

大于10000000

则终止(长i = 5;计数器<1000000; i + = 2,flag = 1)


{


//检查满足sqrt(i)> = prime

for(long j = 2; prime [j]< long(sqrt(double(i))+ 1); j ++)


{


if(i%prime [j] == 0)//我不是素数,回到第一个循环


{


flag = 0;


休息;


}


}

如果(旗帜)


//现在我们知道我是一个素数(因为它不可被整除任何素数

(root(i)> =素数)


{


prime [counter] = i;


counter ++;


if(counter%nth == 0)printf(" \t%ld",i );


if(counter% (nth * pause)== 0)getch();


flag = 0;


}


其他


继续;


}


printf(" \ n ***** ***** ***** ***** ***** *** *** *** *** *** *** *** *** *** *** *** \ n \\ n \\ n \\ n \\ n \\ n \\ n \\ n \\ n \\ n \\ n>
退出任何键;


getch();


返回0;


}


/ ********************** ****


//将前1000000个素数存储到二进制文件的代码:


//将代码放在END该文件


FILE * fp = fopen(" 15000pri.bin"," r + b");


if( !fp)printf(无法打开文件);


fwrite(prime,sizeof(prime)* 1000000,1,fp);


if(fclose(fp))


printf(" \\\
\\\
file not closed\\\
\\\
);


其他


printf(" \ n\\\
file已成功关闭\ n \ nn);

getch();


//从二进制文件中获取前1000000个素数的代码:


//地方宣布* prime后的代码


FILE * fp = fopen(" 15000pri.bin"," r + b");


if(!fp)printf(无法打开文件);


fread(prime,sizeof(prime)* 1000000,1,fp);


if(fclose(fp))


printf(" \\\
\\\
file not closed\\\
\ n);


其他


printf(\ n\\\
file已成功关闭\ n \ nn);


getch();


//代码,用于检查数字%暂停时数字为素数的可能性== 0


//暂停是用户输入的变量


双倍机会= 1.0;


for(long k = 1; k <1000000; k ++)


{


if(k%(pause / 1000)== 0)printf(" %ld",prime [k]);


机会 - = dou ble(1.0 / double(prime [k])*偶然);


if(k%pause == 0){printf(" \t%f\t%) LD",机会,K);的getch(); } $ / $

//检查范围内的素数(最大1,000,000,000,000)的代码


//你必须从一个文件中加载前1,000,000个素数或者计算好

到数组中(素数[1000000])


__int64 lower,upper;


printf(&\\; \ n \ nnase请输入较低的范围。\ nn \ n请选择一个数字

5和10 ^ 12 (1和12个零),或0表示退出\ n;;


fflush(stdin);


scanf(" ;%I64"& lower);


if(!nth)返回0;


printf("请输入更低版本) range.\\\
please选择5

和10 ^ 12(1和12个零)之间的数字);


fflush( stdin);


scanf("%I64"& upper);


if(upper< 5 || upper> pow (10.0,12.0)|| lower< 5 || lower> pow(10.0,12.0))


{printf(" invalid range ... exiting& QUOT);的getch();返回0; }


for(__ int64 l = lower; l< = upper; l + = 2,flag = 1)


{


//检查所有满足sqrt(i)> = prime


的素数(长m = 2;素数[m] <长( sqrt(double(l))+ 1); m ++)


{


if(l%prime [m] == 0) //我不是素数,回到第一个循环


{


flag = 0;

休息;


}


}

if(flag)


//现在我们知道我是一个素数(因为它不能被任何素数整除

(root(i)> = prime)


{


printf(" \t%I64",l);


flag = 0;


}


其他


继续;


}


// **************************** /


hi all

I''m a newbie to this group. my apologies if I break any rules.

I''ve wrote a simple program to find the first 1,000,000 primes, and to find
all primes within any range (up to 200 * 10^12)

it''s pretty efficient, it took 15 minutes to compute the first 1,000,000
primes.

I would like to here your opinion about it

p.s. I''m not a mathematician, in fact, my math level is primary school
(hardly).

please Cc all replies to ae****@arach.net.au

replace the aesqq with (hrneo) before the @,

thanks

michael

//compiler: ms visual c++ 7.0

#include <stdio.h>

#include <conio.h>

#include <math.h>

int main()

{

long nth,pause;

//************collect info from user**************

printf("\t***WELCOME***\nthis program displays all prime numbers up to about
2 billion\nsince the output proccess taks a lot of resources,if you wish to
display large numbers, it is recommended that you set the Nth prime to be
larger then 100");

printf("\n\nplease enter the Nth prine to be displayed, if you select 10,
the 10th, 20th, 30th... primes will be displayed.\n\nplease select a number
between 1 and 10,000, or 0 to exit\n");

fflush(stdin);

scanf("%d",&nth);

if (!nth) return 0;

printf("please enter after how meny numbers to pause. plese select a number
between 2 and 10,000\n");

fflush(stdin);

scanf("%d",&pause);

//************end collect info from user**************

//create and arry to store the first 5000 primes:

long *prime = new long[1000000];long counter=3;bool flag =1;

prime[0]=1;prime[1]=2;prime[2]=3; //set the first three primes

printf("\n\n\t\t---finished\n\n"); getch();

// i is the number that will be checked if it''s a prime

//loop with i = 5 initially, add 2 to i evey cycle,terminate if the counter
is greater then 10000000

for (long i=5;counter<1000000;i+=2,flag=1)

{

//check all primes that satisfy sqrt(i) >= prime

for (long j=2;prime[j]<long(sqrt(double(i))+1);j++)

{

if (i%prime[j]==0)//i is not a prime, go back to the first loop

{

flag=0;

break;

}

}
if (flag)

// now we know that i is a prime (since it''s not divisible by any prime that
( root(i) >= prime )

{

prime[counter]=i;

counter++;

if(counter%nth==0) printf("\t%ld",i);

if (counter%(nth*pause)==0) getch();

flag=0;

}

else

continue;

}

printf("\n\n***************************finished*** ***************\n\npress
any key to exit");

getch();

return 0;

}

/**************************

//code to store the first 1000000 primes to a binary file:

//place the code at the END of the file

FILE *fp=fopen("15000pri.bin","r+b");

if (!fp) printf("unable to open file");

fwrite(prime,sizeof(prime)*1000000,1,fp);

if (fclose(fp))

printf("\n\nfile not closed\n\n");

else

printf("\n\nfile successfully closed\n\n");

getch();

//code to get the first 1000000 primes from the binary file:

//place the code right after the declaration of *prime

FILE *fp=fopen("15000pri.bin","r+b");

if (!fp) printf("unable to open file");

fread(prime,sizeof(prime)*1000000,1,fp);

if (fclose(fp))

printf("\n\nfile not closed\n\n");

else

printf("\n\nfile successfully closed\n\n");

getch();

//code to check the chances of a number being a prime when number%pause==0

// pause is a variable entered by the user

double chance = 1.0;

for (long k=1;k<1000000;k++)

{

if (k%(pause/1000)==0) printf("%ld ",prime[k]);

chance -= double(1.0/double(prime[k])*chance);

if (k%pause==0) {printf("\t%f\t%ld",chance,k); getch(); }

}

//code to check primes within a range (maximum 1,000,000,000,000)

// you must have the first 1,000,000 primes loaded from a file or calculated
into the array (prime[1000000])

__int64 lower,upper;

printf("\n\nplease enter the lower range.\n\nplease select a number between
5 and 10^12 (1, and 12 zeroes) , or 0 to exit\n");

fflush(stdin);

scanf("%I64",&lower);

if (!nth) return 0;

printf("please enter the lower range.\n\nplease select a number between 5
and 10^12 (1, and 12 zeroes)");

fflush(stdin);

scanf("%I64",&upper);

if (upper<5 || upper>pow(10.0,12.0) || lower<5 || lower>pow(10.0,12.0))

{ printf("invalid range...exiting"); getch(); return 0; }

for (__int64 l=lower;l<=upper;l+=2,flag=1)

{

//check all primes that satisfy sqrt(i) >= prime

for (long m=2;prime[m]<long(sqrt(double(l))+1);m++)

{

if (l%prime[m]==0)//i is not a prime, go back to the first loop

{

flag=0;

break;

}

}
if (flag)

// now we know that i is a prime (since it''s not divisible by any prime that
( root(i) >= prime )

{

printf("\t%I64",l);

flag=0;

}

else

continue;

}

//****************************/


推荐答案

2003年12月9日星期二07:23:50 +0800,其他人

< zo **** @ fuck.the。 spammers.net>在comp.lang.c中写道:
On Tue, 9 Dec 2003 07:23:50 +0800, "someone else"
<zo****@fuck.the.spammers.net> wrote in comp.lang.c:
嗨所有


你自己。

我是新手对这个群体。如果我违反任何规则我会道歉。


其中一个非常重要的事实。

我写了一个简单的程序来找到前1,000,000个素数,并找到<任何范围内的所有素数(高达200 * 10 ^ 12)

它非常有效,计算前1,000,000个素数需要15分钟。

我想在这里你的意见

ps我不是数学家,事实上,我的数学水平是小学(很难)。

请Cc全部回复 ae **** @ arach.net.au

在@之前用(hrneo)替换aesqq,

谢谢

迈克尔

//编译器:ms visual c ++ 7.0
#include< stdio.h>

#include< conio.h>


非标准标题。

#include< math.h>

int main()
{

很长,暂停;

// ************收集用户的信息*********** ***

printf(\t *** WELCOME *** \这个程序显示所有素数达到约20亿•因为输出过程需要一个很多资源,如果你想显示大数字,建议你设置Nth prime要大于100);

printf(" \\ \\ n \\ n \\ n \\ n \\ n请输入要显示的第N个prine,如果选择10,将显示第10个,第20个,第30个... primes。\ n \\ nnnase选择一个数字之间
1和10,000,或0退出\ n");

fflush(stdin);


哦,你已经离开并调用未定义的行为。 fflush()

函数在输入流上未定义。

scanf("%d"& nth);


如果用户输入的值超出了signed int的

范围,则为未定义的行为。

if(! n)返回0;

printf(请输入数据后暂停的数字。请在2到10,000之间选择一个数字。);

fflush(stdin);

scanf("%d"& pause);

// ************收集用户的信息**************

//创建并存储前5000个素数:

long * prime = new long [1000000]; long counter = 3; bool flag = 1;


这是你破坏的最大规则:


***这不是所有的代码*** />

没有new这样的东西在C中,除非你有一个支持C99的< stdbool.h>的编译器,否则也没有类型bool

标题和

已包含该标题。这就省去了发布给数据的每一个Microsoft

编译器。


[snip]

printf(" \ nn \
\t\t --- finished\\\
\\\
"); getch();
hi all
Hi yourself.
I''m a newbie to this group. my apologies if I break any rules.
One very important one, as a matter of fact.
I''ve wrote a simple program to find the first 1,000,000 primes, and to find
all primes within any range (up to 200 * 10^12)

it''s pretty efficient, it took 15 minutes to compute the first 1,000,000
primes.

I would like to here your opinion about it

p.s. I''m not a mathematician, in fact, my math level is primary school
(hardly).

please Cc all replies to ae****@arach.net.au

replace the aesqq with (hrneo) before the @,

thanks

michael

//compiler: ms visual c++ 7.0

#include <stdio.h>

#include <conio.h>
Non-standard header.
#include <math.h>

int main()
{

long nth,pause;

//************collect info from user**************

printf("\t***WELCOME***\nthis program displays all prime numbers up to about
2 billion\nsince the output proccess taks a lot of resources,if you wish to
display large numbers, it is recommended that you set the Nth prime to be
larger then 100");

printf("\n\nplease enter the Nth prine to be displayed, if you select 10,
the 10th, 20th, 30th... primes will be displayed.\n\nplease select a number
between 1 and 10,000, or 0 to exit\n");

fflush(stdin);
Oh, there you''ve gone and invoked undefined behavior. The fflush()
function is undefined on input streams.
scanf("%d",&nth);
Undefined behavior if the value typed in by the user is outside the
range of a signed int.
if (!nth) return 0;

printf("please enter after how meny numbers to pause. plese select a number
between 2 and 10,000\n");

fflush(stdin);

scanf("%d",&pause);

//************end collect info from user**************

//create and arry to store the first 5000 primes:

long *prime = new long[1000000];long counter=3;bool flag =1;
Here''s the biggest rule that you broke:

***THIS IS NOT C CODE AT ALL***

There is no such thing as "new" in C, nor is there a type "bool"
unless you have a compiler that supports C99''s <stdbool.h> header and
have included that header. That leaves out every single Microsoft
compiler released to data.

[snip]
printf("\n\n\t\t---finished\n\n"); getch();




在C或C ++语言中没有名为getch()的函数。


总的来说,您的代码中充斥着非标准Microsoft特定的

扩展,这些扩展不属于标准C或C ++。你应该将

发布到comp.lang.c或comp.lang.c ++,直到你至少知道$ c $ b C和C ++之间的差异。一个更好的地方可能是

组新闻:comp.alt.lang.learn.c-c ++直到你知道更多。


你还应该如果你想使用C,那就得到一本好的C编程书,

就像这两个很好的选择之一:


C编程语言,第二版

Brian W. Kernighan& Dennis M. Ritchie

Prentice Hall 1988

精装书ISBN 0131103709

精装书ISBN 0131103628


C编程:现代方法

KN King

WW Norton& 1996年公司

Softcover ISBN 0393969452

最后,你正在重新发明一个全面的轮子。在Google上搜索

的短语Sieve of Eratosthenes找到一个几千年前的算法。


-

Jack Klein

主页: http://JK-Technology.Com



comp.lang.c的常见问题解答 http://www.eskimo.com/~scs/C-faq/top.html

comp.lang.c ++ http://www.parashift.com/c++-faq-lite/

alt.comp.lang.learn.c-c ++ ftp:// snurse -l.org/pub/acllc-c++/faq



There is no function named getch() in either the C or C++ language.

Overall, your code is littered with non-standard Microsoft specific
extensions that are not part of either standard C or C++. You should
not be posting to comp.lang.c or comp.lang.c++ until you at least know
the difference between C and C++. A better place for you might be the
group news:comp.alt.lang.learn.c-c++ until you know more.

You should also get a good C programming book if you want to use C,
like one of these two excellent choices:

The C Programming Language, Second Edition
Brian W. Kernighan & Dennis M. Ritchie
Prentice Hall 1988
Hardcover ISBN 0131103709
Softcover ISBN 0131103628

C Programming: A Modern Approach
K. N. King
W. W. Norton & Company 1996
Softcover ISBN 0393969452

Finally, you are reinventing a well-rounded wheel. Do a Google search
on the phrase "Sieve of Eratosthenes" to find an algorithm that is
several thousand years old.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq


Eratosthenes筛选:


列出清单所有小于或等于n的整数(并且大于

one)。

打出小于或等于平方根的所有素数的倍数

of n。

然后是数字t帽子留下了素数。


" Jack Klein" < JA ******* @ spamcop.net>在消息中写道

新闻:9h ******************************** @ 4ax.com ...
Sieve of Eratosthenes:

Make a list of all the integers less than or equal to n (and greater than
one).
Strike out the multiples of all primes less than or equal to the square root
of n.
Then the numbers that are left are the primes.

"Jack Klein" <ja*******@spamcop.net> wrote in message
news:9h********************************@4ax.com...
On Tue,2003年12月9日07:23:50 +0800,其他人
< zo **** @ fuck.the.spammers.net>在comp.lang.c中写道:
On Tue, 9 Dec 2003 07:23:50 +0800, "someone else"
<zo****@fuck.the.spammers.net> wrote in comp.lang.c:
大家好
你好。
hi all
Hi yourself.
我是这个小组的新手。如果我违反任何规则我会道歉。
I''m a newbie to this group. my apologies if I break any rules.



其中一个非常重要的事实。



One very important one, as a matter of fact.

我写了一个简单的程序找到前1,000,000个素数,并且
找到任何范围内的所有素数(最多200 * 10 ^ 12)

它非常高效,计算花了15分钟第一个1,000,000

我想在这里你的意见

ps我不是数学家,事实上,我的数学水平是小学(很难)。

请Cc全部回复 ae **** @ arach.net.au

在@之前用(hrneo)替换aesqq,

谢谢

迈克尔

//编译器:ms visual c ++ 7.0
#include< stdio.h>

#include< conio.h>
I''ve wrote a simple program to find the first 1,000,000 primes, and to find all primes within any range (up to 200 * 10^12)

it''s pretty efficient, it took 15 minutes to compute the first 1,000,000
primes.

I would like to here your opinion about it

p.s. I''m not a mathematician, in fact, my math level is primary school
(hardly).

please Cc all replies to ae****@arach.net.au

replace the aesqq with (hrneo) before the @,

thanks

michael

//compiler: ms visual c++ 7.0

#include <stdio.h>

#include <conio.h>



非标头。



Non-standard header.



duh!


duh!

#include< ; math.h>

int main()
{

很久,暂停;

// ***** *******收集用户的信息**************

printf(" \t *** WELCOME *** \ n程序显示所有素数高达
约20亿美元,因为输出处理需要大量资源,如果你希望
显示大数字,建议你将Nth prime设置为
大于100);

printf(" \ nn \ ninase输入要显示的第N个prine,如果选择
10,将显示第10个,第20个,第30个......质数。\ n \\ nnnase选择1到10,000之间的
数,或者0退出\ n");

fflush(stdin);
哦,你已经离开并调用未定义的行为。 fflush()
函数在输入流上未定义。
#include <math.h>

int main()
{

long nth,pause;

//************collect info from user**************

printf("\t***WELCOME***\nthis program displays all prime numbers up to about 2 billion\nsince the output proccess taks a lot of resources,if you wish to display large numbers, it is recommended that you set the Nth prime to be larger then 100");

printf("\n\nplease enter the Nth prine to be displayed, if you select 10, the 10th, 20th, 30th... primes will be displayed.\n\nplease select a number between 1 and 10,000, or 0 to exit\n");

fflush(stdin);
Oh, there you''ve gone and invoked undefined behavior. The fflush()
function is undefined on input streams.
scanf("%d"& nth);
scanf("%d",&nth);


范围,则返回未定义的行为。



Undefined behavior if the value typed in by the user is outside the
range of a signed int.

if(!nth)返回0;

printf(请输入数据后暂停的数字。请在2到10,000之间选择一个
的数字);

fflush(stdin);

scanf("%d"& pause);

// ************结束用户收集信息***** *********

//创建和存储前5000个素数:



抱歉,我的错误,我的意思是前1,000,000个素数
long * prime = new long [1000000]; long counter = 3; bool flag = 1;
if (!nth) return 0;

printf("please enter after how meny numbers to pause. plese select a number between 2 and 10,000\n");

fflush(stdin);

scanf("%d",&pause);

//************end collect info from user**************

//create and arry to store the first 5000 primes:

sorry, my mistake, i meant the first 1,000,000 primes
long *prime = new long[1000000];long counter=3;bool flag =1;



这里是最大的规则你破了:

***这不是所有的代码***

没有新这样的东西在C中,也没有类型bool
除非你有一个支持C99的< stdbool.h>的编译器。标题和
包括该标题。这使得每个Microsoft
编译器都不会发布数据。



Here''s the biggest rule that you broke:

***THIS IS NOT C CODE AT ALL***

There is no such thing as "new" in C, nor is there a type "bool"
unless you have a compiler that supports C99''s <stdbool.h> header and
have included that header. That leaves out every single Microsoft
compiler released to data.




是的,我可以使用:

long * prime = malloc(sizeof(long)* 1000000)

但是我试图通过避免使用指针来保持代码的可读性,

和bool也可以是int


[snip]



true, i could have used:
long *prime = malloc(sizeof(long)*1000000)
but i tried to keep the code more readable by avoiding the use of pointers,
and "bool" could as well have been int

[snip]

printf(" \ n\\\
\t\t- --finished\\\
\\\
"); getch();
在C或C ++语言中没有名为getch()的函数。
printf("\n\n\t\t---finished\n\n"); getch();
There is no function named getch() in either the C or C++ language.




getch()是一个暂停DOS的指令控制台,直到按下键,所以

它必须是特定于平台和非标准的。

总体而言,您的代码充斥着非标准的Microsoft特定扩展这不是标准C或C ++的一部分。你应该不要发布到comp.lang.c或comp.lang.c ++,直到你至少知道C和C ++之间的区别。对你来说更好的地方可能是
组新闻:comp.alt.lang.learn.c-c ++直到你知道更多。

如果你有一个好的C编程书你也应该想要使用C,
就像这两个很好的选择之一:

C编程语言,第二版
Brian W. Kernighan& Dennis M. Ritchie
Prentice Hall 1988
精装书ISBN 0131103709
精装书ISBN 0131103628

C编程:现代方法
KN King
WW诺顿&公司1996
Softcover ISBN 0393969452

最后,您正在重新发明一个全方位的车轮。对Eratosthenes筛选一词进行谷歌搜索
找到几千年前的算法。


因为我在开始时引用,Sieve of Eratosthenes是基于创建所有数字的

数组,而我只创建了一个素数数组,我我知道

有更多复杂的方法可以检查素数,但他们需要一个

的大学学位数学,而且他们中的大多数只是说这个数字是

几乎肯定是一个主要的虽然我的方式是绝对肯定的,并且可以是非数学家的unde


最后,因为标准c中没有64位整数,我使用了

microsoft'的实现,我可以使用64个

位整数的其他库。


all我可以说如果像getch()这样的东西会打扰你,我就不应该再发布
了,而且新闻:comp.alt.lang.learn.c-c ++是非活跃的团体
-
Jack Klein



getch() is an istruction to pause the DOS console until a key is pressed so
it has to be platform specific and non standard.

Overall, your code is littered with non-standard Microsoft specific
extensions that are not part of either standard C or C++. You should
not be posting to comp.lang.c or comp.lang.c++ until you at least know
the difference between C and C++. A better place for you might be the
group news:comp.alt.lang.learn.c-c++ until you know more.

You should also get a good C programming book if you want to use C,
like one of these two excellent choices:

The C Programming Language, Second Edition
Brian W. Kernighan & Dennis M. Ritchie
Prentice Hall 1988
Hardcover ISBN 0131103709
Softcover ISBN 0131103628

C Programming: A Modern Approach
K. N. King
W. W. Norton & Company 1996
Softcover ISBN 0393969452

Finally, you are reinventing a well-rounded wheel. Do a Google search
on the phrase "Sieve of Eratosthenes" to find an algorithm that is
several thousand years old.
as i quoted at the beggining, Sieve of Eratosthenes is based on creating an
array of all numbers, while i only created an array of primes, i''m aware
that there are more comlex ways of checking for primes but they require a
university degree in math, and most of them only say that the number is
"allmost sertainly a prime" while my way is absolutely certain, and can be
undestood by non mathematician''s.
and finally, since there''s no 64 bit integers in standard c, i used
microsoft''s implementation, i could have as well used other libraries for 64
bit integers.

all i can say is that if things as nimor as getch() disturb you, i shouldn''t
post here anymore, and news:comp.alt.lang.learn.c-c++ is a non active group
--
Jack Klein



michael


michael


别人写道:

.... snip ..
所有我能说的是,如果像getch()这样的东西会打扰你,我不应该再在这里发帖了, news:comp.alt.lang.learn.c-c ++
是一个非活动组
从后面:不,新闻之一:comp.lang.learn.c-c ++和
.... snip ..
all i can say is that if things as nimor as getch() disturb you,
i shouldn''t post here anymore, and news:comp.alt.lang.learn.c-c++
is a non active group From the rear: No, one of news:comp.lang.learn.c-c++ and



news:alt.lang.learn.c-c ++不是非活跃的。也许你

不应该。代词我应该大写。 getch()确实

在标准C中不存在。我不知道nimor这个词。

代词''我'应该大写。判决通常应该以大写字母开始。


如果nimor意图正常,那就是getch

在C程序中不是正常的事情,除了在某些操作系统下使用某些编译器的相对较小的b $ b小子集中,因此没有理由做出任何假设<关于getch做什么的



-

查克F(cb ******** @ yahoo。 com)(cb********@worldnet.att.net)

可用于咨询/临时嵌入式和系统。

< http:// cbfalconer.home.att.net>使用worldnet地址!


news:alt.lang.learn.c-c++ is not non-active. Maybe you
shouldn''t. The pronoun ''I'' should be capitalized. getch() does
not exist in standard C. The word nimor is unknown to me. The
pronoun ''I'' should be capitalized. Sentences should usually begin
with a capital letter.

Should nimor be intended to mean normal, the point is that getch
is not a normal thing in C programs, except within the relatively
small subset using certain compilers under certain operating
systems, and thus there is no reason to make any assumptions
whatsoever about what getch does.

--
Chuck F (cb********@yahoo.com) (cb********@worldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!


这篇关于查找素数的简单算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆