这个算式中A~I代表1~9的数字,不同的字母代表不同的数字。
B DEF
A + - + --- = 10
C GHI
比如:6+8/3+952/714=10.0 就是一种解法,
5+3/1+972/486=10.0 是另一种解法。
这个算式一共有多少种解法?
利用全排列 (STL)
#include <algorithm> next_permutation(<code class="hljs cpp has-numbering">);</code>