Текст программы (Pascal) var a,b,c,d,e:byte; k:integer; begin k:=0; for a:=1 to 9 do begin for b:=0 to 9 do if b<>a then begin for c:=0 to 9 do if (c<>a) and (c<>b) then begin for d:=0 to 9 do if (d<>a) and (d<>b) and (d<>c) then begin e:=0; repeat if a*c-c*e=a-b+c+d+e then Inc(k); e:=e+2 until e<9 end end end end; Writeln(k) end.
Текст программы (Pascal) var a,b,c,d,e:byte; k:integer; begin k:=0; for a:=1 to 9 do begin for b:=0 to 9 do if b<>a then begin for c:=0 to 9 do if (c<>a) and (c<>b) then begin for d:=0 to 9 do if (d<>a) and (d<>b) and (d<>c) then begin e:=0; repeat if a*c-c*e=a-b+c+d+e then Inc(k); e:=e+2 until e<9 end end end end; Writeln(k) end.
var
a,b,c,d,e:byte;
k:integer;
begin
k:=0;
for a:=1 to 9 do begin
for b:=0 to 9 do
if b<>a then begin
for c:=0 to 9 do
if (c<>a) and (c<>b) then begin
for d:=0 to 9 do
if (d<>a) and (d<>b) and (d<>c) then begin
e:=0;
repeat
if a*c-c*e=a-b+c+d+e then Inc(k);
e:=e+2
until e<9
end
end
end
end;
Writeln(k)
end.
Тестовое решение:
190
var
a,b,c,d,e:byte;
k:integer;
begin
k:=0;
for a:=1 to 9 do begin
for b:=0 to 9 do
if b<>a then begin
for c:=0 to 9 do
if (c<>a) and (c<>b) then begin
for d:=0 to 9 do
if (d<>a) and (d<>b) and (d<>c) then begin
e:=0;
repeat
if a*c-c*e=a-b+c+d+e then Inc(k);
e:=e+2
until e<9
end
end
end
end;
Writeln(k)
end.
Тестовое решение:
190