Even though this is a 3rd-grade math problem, people found it extremely hard. Any people have a solution, or algorithm is welcome. I'll try make a program base on the algorithm and see if it's correct. And, people are welcome to provide the best solution (least loop, recursion)
Enough said, here's the original: Fill in the blank the number from 1-9 to complete the equation. (probably distinct numbers each blank)
PS: Help me with tags. I'm not sure which tags should I use.
EDIT 1: After a few shortened, here's what I've got:
a + d - f + 12*e + 13*b/c + g*h/j = 87.
So, as you see, the priority does matter.
EDIT 2: Maybe my description is not clear enough, but I think it require to use every number
Like this: an array from [1:9], each fill in the blank remove one component.
As Martigan point out, it's like: fill in the blanks using once and only once each number from 1 to 9. Simple math here: There are 9*8*7*6*5*4*3*2 = 362880 possibilitities. (You may correct this simple math if I'm wrong).
And b mod c should = 0 (as only integers appear.)
EDIT 3: I just asked my mom (who's an elementary teacher). She's confirmed that 3rd grade has studied about mathematic priority, so sorry Hagen von Eitzen. Your answer is half right, she'd give you an 7/10.
PS2: People, please share your wisdom and provide the math algorithm.
Sorry for my bad English.
Best Answer
I assume that (as usual in this type of problem) the operations are executed left toright (not by arithemtic priority). Here are the solutions: