var
i,sum:integer;
begin
sum:=0;//总个数
i:=3;
repeat
if pos('3',inttostr(i))>0 then
begin
inc(sum);
writeln(inttostr(i));
end;
inc(i);
Until i>1000;
writeln(inttostr('总数为:'sum));
end.
var
t,i:integer;
function fj(x:integer):boolean;
var
y:integer;
begin
fj:=true;
y:=x;
while x>0 do
begin
if (y mod 10)=3 then
begin
fj:=false;
exit;
end
else y:=y div 10;
end;
end;
begin
for i:=1 to 1000 do
if fj(i) then
begin
t:=t+1;
write(i,' ');
writeln(t);
end.