mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 17:29:11 +02:00
* the algorythm was wrong (unnecessary checks were made)
This commit is contained in:
parent
5bde11ba3b
commit
d154df9536
@ -26,8 +26,9 @@ program eratosthenes;
|
|||||||
for i:=1 to max do
|
for i:=1 to max do
|
||||||
a[i]:=true;
|
a[i]:=true;
|
||||||
for i:=2 to max div 2 do
|
for i:=2 to max div 2 do
|
||||||
for j:=2 to max div i do
|
if a[i] then
|
||||||
a[i*j]:=false;
|
for j:=2 to max div i do
|
||||||
|
a[i*j]:=false;
|
||||||
writeln;
|
writeln;
|
||||||
for i:=1 to max do
|
for i:=1 to max do
|
||||||
if a[i] then
|
if a[i] then
|
||||||
@ -42,7 +43,10 @@ program eratosthenes;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.3 1998-04-06 12:23:21 pierre
|
Revision 1.4 1998-09-04 17:38:15 pierre
|
||||||
|
* the algorythm was wrong (unnecessary checks were made)
|
||||||
|
|
||||||
|
Revision 1.3 1998/04/06 12:23:21 pierre
|
||||||
* log problem
|
* log problem
|
||||||
|
|
||||||
Revision 1.2 1998/04/06 12:17:00 pierre
|
Revision 1.2 1998/04/06 12:17:00 pierre
|
||||||
|
Loading…
Reference in New Issue
Block a user