Witam,
Wyskakują mi błędy chyba natury składniowej ;p tylko nie wiem o co chodzi bo google odsyła do Rosji. Wszystkie tyczą się chyba tego samego ;p Ogólnie chodzi o ostatniego while i o to, że chcę sobie stringi pododawać ;D
[dcc32 Error] pp.pas(70): E2035 Not enough actual parameters
[dcc32 Warning] pp.pas(70): W1057 Implicit string cast from 'ShortString' to 'string'
[dcc32 Error] pp.pas(70): E2066 Missing operator or semicolon
[dcc32 Error] pp.pas(71): E2035 Not enough actual parameters
[dcc32 Warning] pp.pas(71): W1057 Implicit string cast from 'ShortString' to 'string'
[dcc32 Error] pp.pas(71): E2035 Not enough actual parameters
[dcc32 Warning] pp.pas(71): W1057 Implicit string cast from 'ShortString' to 'string'
procedure TForm1.Button1Click(Sender: TObject);
var
napi: String;
x: integer;
i: integer;
e: integer;
k: integer;
j: integer;
t: array of integer;
begin
x:=strtoint(Edit1.Text);
k:=floor(x/2+1);
j:=0;
while(j<k)do
begin
t[j]:=0;
j:=j+1;
end;
i:=2;
e:=floor(sqrt(x));
while i<=e do
begin
while (x mod i) = 0 do
begin
t[i]:=t[i]+1;
x := x div i;
e := floor(sqrt(x));
end;
i := i + 1;
end;
if x > 1 then t[x]:=t[x]+1;
j:=2;
while(j<k) do
begin
if t[i]=1 then napi:=napi+str(i)+'*'
else napi:=napi+str(i)+'^'+str(t[i])+'*';
end;
Edit2.Text:=napi;
end;
end.