{Escribir un algoritmo que descomponga un numero en sus factores primos}
program ocho;
uses crt;
var
num,j,i,k:integer;
begin
writeln('Este programa descompone un numero en sus factores primos');
read(num);
k:=0;
for i:=1 to num do
begin
if ((num mod i) = 0) then
begin
for j:=1 to i do
begin
if (i mod j = 0) then
begin
k:=k+1;
end;
end;
if (k=2) then
begin
writeln(i);
end;
k:=0;
end;
end;
end.