program test;
var
x,p,r,s,b : integer;
begin
write('enter a number:');
readln(x);
p:=0;
while (x<>0) do
begin
r:=x mod 10;
if (r=8) then
r:=5
else
if (r=5) then
r:=3;
x:=x div 10;
p:=p*10+r;
end;
s:=0;
while (p<>0) do
begin
b:=p mod 10;
p:=p div 10;
s:=s*10+r;
end;
write(s);
readln
end.
منبع: www.parsigold.com
var
x,p,r,s,b : integer;
begin
write('enter a number:');
readln(x);
p:=0;
while (x<>0) do
begin
r:=x mod 10;
if (r=8) then
r:=5
else
if (r=5) then
r:=3;
x:=x div 10;
p:=p*10+r;
end;
s:=0;
while (p<>0) do
begin
b:=p mod 10;
p:=p div 10;
s:=s*10+r;
end;
write(s);
readln
end.
منبع: www.parsigold.com