program a008;
var s:array[0..1000] of integer;
i,m:longint;
d:boolean;
begin
repeat
readln(m);
i:=2;
repeat
s[i]:=0
repeat
d:=true;
if m mod i<>0 then d:=false;
if m mod i=0 then begin
s[i]:=s[i]+1;
m:=m div i;
end;
until d=false;
if s[i]>0 then write(i);
if s[i]>1 then write('^',s[i]);
if (s[i]>0)and(m<>1) then write(' * ');
i:=i+1;
until i>m;
writeln
until eof;
end.
在电脑上是对的啊 怎么RE了
program a008;
var s,c:array[0..1000] of integer;
i,k,l,m:longint;
d:boolean;
begin
while not eof do begin
readln(m);
i:=2;
k:=1;
l:=k;
fillchar(s,sizeof(s),0);
fillchar(c,sizeof(c),0);
while (i<=m)and(m<>1) do begin
repeat
d:=true;
if m mod i<>0 then d:=false;
if (m mod i=0)and(l=k) then begin
m:=m div i;
s[l]:=i;
k:=k+1;
c[l]:=c[l]+1;
end;
if (m mod i=0)and(l<>k) then begin
c[l]:=c[l]+1;
m:=m div i;
end;
until d=false;
i:=i+1;
l:=l+1;
k:=l;
end;
for i:=1 to (l-1) do begin
if c[i]<>0 then write(s[i]);
if c[i]>1 then write('^',c[i]);
if (c[i]<>0)and(i<>l-1) then write(' * ');
end;
writeln;
end;
end.
这个是修改后的还是RE啊