题目: |
Program ZX2017p4;
var a:array[2..6] of integer;
i, j, m:integer;
begin
for i :=2 to 6 do
a[i]:=i+1;
repeat
m:=2;
for i:=3 to 6 do
if a[m]>a[i] then m:=i;
a[m]:=a[m]+m;
m:=1;
for i:=2 to 5 do
for j:=i+1 to 6 do
if a[i]<a[j] then m:=0;
until m<>0;
write(a[2]:6);
end.
输出: 61
|