Answer the question
In order to leave comments, you need to log in
How to sort prime numbers in an array in pascal?
program p1;
uses crt;
type
massive = array of integer;
var
n: byte;
i: byte;
a: massive;
begin
clrscr;
write('Введите размер массива: '); read(n);
write('Массив: ');
setlength(a, n);
randomize;
for i := low(a) to high(a) do
begin
a[i] := random(n);
write(a[i]:4);
end;
end.
Answer the question
In order to leave comments, you need to log in
Dozens and hundreds of algorithms in the network
For example, I sort like this
var Items := RandomRange(10);
print(Items);
TArrayHelp.Sort(Items);
print(Items);
[0, 3, 86, 20, 27, 67, 31, 16, 37, 42]
[0, 3, 16, 20, 27, 31, 37, 42, 67, 86]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question