什么数学题算出来等于5201314求解
昨天出的
已知a,b,c,d,e,f,g均为整数且大于等于0并小于等于10,且满足以下等式:
a + b * c = 5
c + d + a * b * ( g + e - f ) = 61
g * ( c + d + a * b * e * f ) = 124
求a,b,c,d,e,f,g的值
js代码验证:
var a,b,c,d,e,f,g;
var x = [0,0,0,0,0,0,0];
var done = false;
while(!done) {
a = x[0], b = x[1], c = x[2], d = x[3], e = x[4], f = x[5], g = x[6];
if
((a + b * c == 5) &&
(c + d + a * b * (g + e - f) == 61) &&
(g * (c + d + a * b * e * f) == 124)) {
alert(x);
}
x[0] += 1;
for(var v = 0; v < 7; v++) {
if (x[v] == 11) {
if (v == 6) {
done = true;
} else {
x[v] = 0;
x[v + 1] += 1;
}
}
}
}