一个关于24点的问题

来源:百度知道 编辑:UC知道 时间:2024/05/23 12:29:21
2³*[1-(-2)]=24
2³*(-2-1)=24
根据上述规律,把下列数字用加减乘除乘方运算,最后结果为24或-24

3 4 10 -6 =24
7 7 3 -3 =-24

不用乘方的话我能算出,但是非要加上乘方的话我就算不出了

经数学证明:无解!
附上程序:
begin
case op1 of
1:bc:=b+c;
2:bc:=b-c;
3:bc:=b*c;
4:if c=0 then continue else bc:=b/c;
end;
for op2:=1 to 4 do
begin
case op2 of
1:bcd:=bc+d;
2:bcd:=bc-d;
3:bcd:=bc*d;
4:if d=0 then continue else bcd:=bc/d;
end;
for op3:=1 to 4 do
begin
case op3 of
1:abcd:=a+bcd;
2:abcd:=a-bcd;
3:abcd:=a*bcd;
4:if bcd=0 then continue else abcd:=a/bcd;
end;
if abs(abcd-24)<0.01 then
begin
write(1);
halt;
end;
end;
end;