求一个逆算法的代码
function cBoxCheck(a, b, c, d, e, f, g, h, i, j: Boolean): Integer;
var
x: Integer;
begin
x:= 0;
if a then x:= x + 1;
if b then x:= x + 5;
if c then x:= x + 9;
if d then x:= x + 13;
if e then x:= x + 17;
if f then x:= x + 21;
if g then x:= x + 25;
if h then x:= x + 29;
if i then x:= x + 33;
if j then x:= x + 37;
result:= x;
end;
怎么从返回的结果里得知具体是由哪几个数相加得来的,求求大侠帮帮忙。
[解决办法]
你这好像是个等差数列,根据等差数列的公式往回推算
[解决办法]
逆出来可能多个结果,比如
b、d为true,其他为false,result = 18
a、e为true,其他为false, result 也 = 18
[解决办法]