问题

软件 >> Calculator >> Bug
Questions in category: Bug (Bug).

[Bug] 两种方式运行 eq24() 得到的解不同

Posted by haifeng on 2023-03-16 08:44:40 last update 2023-03-16 08:44:40 | Answers (0) | 收藏


在 cmd 终端交互式输入下, 

>> eq24(1,3,5,7)
in> eq24(1,3,5,7)

(1+5)*(7-3)==24
(5+7)*(3-1)==24

------------------------

Total: 2

 

在文件输出的情况下

例如 test.thl 内容为

eq24(1,3,5,7)

运行 calculator.exe test.thl 后, vim test.out, 有五个解.

3*5+2+7==24
3*7-2+5==24
7*(5-2)+3==24
3*7+5-2==24
3-7*(2-5)==24