for i := 1000 to 9999 do if (i * 4 >= 1000) and (i * 4 <= 9999) then begin s := i * 4; if ((i mod 100) div 10 = ( s div 1000)) then if ((i mod 10) = ( s mod 1000) div 100) then if ( i div 1000 = (s mod 100) div 10) then if ( ((i mod 1000 div 100) <> i div 1000) and ((i mod 1000 div 100) <> (i mod 100) div 10) and ((i mod 1000 div 100) <> i mod 10)) then if ( (s mod 10 <> s div 1000) and (s mod 10 <> (s mod 1000) div 100) and (s mod 10 <> (s mod 100) div 10)) then Writeln(i, ' = ', i * 4); end;
O__o
var
i, s : Integer;
begin
for i := 1000 to 9999 do
if (i * 4 >= 1000) and (i * 4 <= 9999) then
begin
s := i * 4;
if ((i mod 100) div 10 = ( s div 1000)) then
if ((i mod 10) = ( s mod 1000) div 100) then
if ( i div 1000 = (s mod 100) div 10) then
if ( ((i mod 1000 div 100) <> i div 1000) and ((i mod 1000 div 100) <> (i mod 100) div 10) and ((i mod 1000 div 100) <> i mod 10)) then
if ( (s mod 10 <> s div 1000) and (s mod 10 <> (s mod 1000) div 100) and (s mod 10 <> (s mod 100) div 10)) then
Writeln(i, ' = ', i * 4);
end;
Readln;
end.