program p3_5 var integer begin for 100 to 999 do begin mod 10 posledni

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
program p3_5;
var i, a,b,c, n : integer;
begin
for i:= 100 to 999 do
begin
a := i mod 10; {poslednia cifra}
b := (i div 10) mod 10; {srednia cifra}
c := i div 10; {pervaya cifra}
if ((a > b) AND (a > c)) then n := b * 10 + c else
if ((b > a) AND (b > c)) then n := a * 10 + c else
n := a * 10 + b;
if (n*7 = i) then writeln(i);
end;
readln;
end.