回复:逻辑选择题
参考算法:
(*)表示我出过Bug的地方.... >_<
最终答案只有一个: C D E B E E D C B A
1:
// 注意:要从头到尾找完,而不能只看答案有的几个问题
BEGIN
j:= 11;
For i:= 1 to 10 do
if Answer = 2 then
begin
j:= i;
break;
end;
if Answer[1]+1 = j then
Result:= true;
END;
0
2:(*)
// 一定要从头到尾找完,(注意一旦发现异常立刻返回)
begin
for i:= 1 to 9 do
if Answer = Answer[i+1] then
if Answer[2]+1 = i
then Result:= true
else
begin
Result:= false;
break;
end;
end;
0
3:(*)
// 简单(注意序列号)
begin
case Answer[3] of
1: if Answer[3] = Answer[1] then Result:= True;
2: if Answer[3] = Answer[2] then Result:= True;
3: if Answer[3] = Answer[4] then Result:= True;
4: if Answer[3] = Answer[7] then Result:= True;
5: if Answer[3] = Answer[6] then Result:= True;
end;
end;
0
4:
// 简单
begin
j:= 0;
For i:= 1 to 10 do
if Answer = 1 then
Inc(j);
if j+1 = Answer[4] then
Result:= True;
end;
0
5:(*)
// 同样简单(注意序列号)
begin
if Answer[5] = Answer[5+6-Answer[5]] then
Result:= True;
end;
0
6:(*)
// 算法(表面上看)比较的直接
// 注意: 如果有数量相同的答案不一定要选(因为还有可能有其他字母)
// 但是,就一定不能选E了!! XD
begin
j:= 0;
For i:= 1 to 10 do
if Answer = 1 then
Inc(j);
m:= 0;
for l:= 2 to 5 do
begin
k:= 0;
For i:= 1 to 10 do
if Answer = l then
Inc(k);
if (j = k) then
if (Answer[6] = l-1) then
BEGIN
Result:= True;
Break;
END
else m:= 1;
end;
if (Result = False) and (m = 0) and (Answer[6] = 5) then
Result:= True;
end;
0
7:
// 简单
begin
j:= Abs(Answer[7] - Answer[8]);
if (5 - j) = Answer[7] then
Result:= True;
end;
0
8:
// 不难
begin
j:= 0;
For i:= 1 to 10 do
if (Answer = 1) or (Answer = 5) then
Inc(j);
if Answer[8] + 1 = j then
Result:= True;
end;
0
9:
// 考察简单的数学常识?
begin
j:= 0;
For i:= 1 to 10 do
if (Answer = 1) or (Answer = 5) then
Inc(j);
j:= 10 - j;
case Answer[9] of
1: if (j = 2) or (j = 3) or (j = 5) or (j = 7) then
Result:= True;
2: if (j = 1) or (j = 2) or (j = 6) then
Result:= True;
3: if (j = 1) or (j = 4) or (j = 9) then
Result:= True;
4: if (j = 1) or (j = 8) then
Result:= True;
5: if (j = 0) or (j = 5) or (j = 10) then
Result:= True;
end;
end;
0
10:
// 最简单的一道问题...|||
Result:= True;
0