我也是数据点8炸了,不知道为什么,求解
program ex;
var
shu:array[1..9999] of string;
s:string;
l,m,n,k,i,j,sum,len:longint;
begin
read(l,k);
sum:=l;
str(sum,s);
len:=length(s);
shu[1]:=copy(s,len-k+1,k);
for i:=2 to 9999 do
begin
sum:=sum*l;
str(sum,s);
len:=length(s);
shu[i]:=copy(s,len-k+1,k);
for j:=1 to i-1 do
begin
if shu[j]=shu[i] then
begin
write(i,' ',j);
halt;
end;
end;
if len>5 then
begin
s:=copy(s,len-4,5);
val(s,sum);
end;
end;
end.