var
start,finish :integer;
cif,pvt: array [0..10] of integer;
i,j,k,count:integer;
check:array [0..10] of boolean;
begin
write('Введите начальное число ');
readln(start);
write('Введите конечное число ');
readln(finish);
for i:=start to finish do
begin
for j:=0 to 10 do
begin
cif[j]:=0;
pvt[j]:=0;
check[j]:=false;
end;
j:=i;
count:=1;
while j div 10 <>0 do
begin
cif[count]:=abs(j mod 10);
j:=abs(j div 10);
inc(count);
end;
cif[count]:=j mod 10;
for j:=1 to count do
begin
if pvt[cif[j]]=0 then
pvt[cif[j]]:=1;
for k:=j to count do
if (cif[j]=cif[k+1]) and (check[j]=false) then
inc(pvt[cif[j]]);
check[cif[j]]:=true;
end;
count:=0;
for j:=0 to 9 do
if pvt[j]<>0 then inc(count);
if count>2 then
writeln(i);
end;
readln;
end.
Следующий вариант
var
n,m,ii,p:longint;
k:byte;
a:set of byte;
q:boolean;
begin
writeln('vvedite otrezok');
readln(m,n);
for ii:=m to n do
begin
a:=[];
p:=0;
n:=ii;
while (n>0) and (p<3) do
begin
k:=n mod 10;
if not (k in a) then
begin
include(a,k);
inc(p);
if p=3 then
begin
write(ii,' ');
q:=false;
end;
end;
n:=n div 10;
end;
end;
if q then
write('net takix 4isel');
readln;
end.