马桶洗手盆一体好用吗:问一道PASCAL题目
来源:百度文库 编辑:杭州交通信息网 时间:2024/05/06 10:56:22
var a:array[1..6]of integer;
i:integer;
fin:boolean;
begin
for a[1]:=0 to 1 do
for a[2]:=0 to 1 do
for a[3]:=0 to 1 do
for a[4]:=0 to 1 do
for a[5]:=0 to 1 do
begin
a[6]:=0;
fin:=true;
for i:=1 to 5 do a[6]:=a[6]+a[i];
if a[6]<>3 then fin:=false;
if (a[1]+a[3]=2)or(a[2]+a[3]=0) then fin:=false;
if (a[3]=1)and(a[4]+a[5]<>1) then fin:=false;
if a[2]+a[3]+a[4]=3 then fin:=false;
if (a[2]=1)and(a[4]+a[5]=2) then fin:=false;
if fin then
begin
for i:=1 to 5 do
if a[i]=1 then write(chr(ord('A')+i-1));
writeln;
end;
end;
end.
附:
最终结果有3个:1.BCE 2.ABE 3.ABD
BCE、ABD或ABE