Hello,
I'm new to FPC and Lazarus.
I've been trying to make this work for a while but it just doesn't do anything, can someone please give me an idea of what I am doing wrong?
PROGRAM numerosprimos1 (input, output);
VAR
numero, n, p, base1, potencia, modulo, m: integer;
BEGIN
n:=2;
p:=1;
base1:=0;
readln(numero);
while n<numero do
BEGIN
m:=n;
modulo:=numero MOD m;
if modulo=0 then
BEGIN
base1:=m;
potencia:=p;
m:=m*m;
p:=p+1;
END
else
BEGIN
if base1>0 then
BEGIN
if potencia>1 then
BEGIN
writeln(base1,'^',potencia);
potencia:=1;
base1:=0;
numero:=numero-m;
END
else
BEGIN
writeln(base1);
base1:=0;
numero:=numero-m;
END
END
else
n:=n+1;
END
END
END.