F#: 280 chars, incl. newlines
The unreadable version:
let q s=System.Data.DataTable().Compute(s,"")|>string|>float
let e(a,b,c)=let o=["+";"-";"*";"/"]in for x in o do for y in o do let s=a+x+b+y+c in printfn"%s=%.0f"s (q s)
[]let p(A:_[])=(for i=0 to 2 do let p,q,r=A.[i],A.[(i+1)%3],A.[(i+2)%3]in e(p,q,r);e(p,r,q));0
The tl;dr version:
//This program needs to be compiled as a console project
//It needs additional references to System.Data and System.Xml
//This function evaluates a string expression to a float
//It (ab)uses the Compute method of System.Data.DataTable which acts
//as .Net's own little eval()
let q s =
//the answer is an object
System.Data.DataTable().Compute(s,"")
//so convert it to a string and then parse it as a float
|> string
|> float
//This function first generates all 6 permutations of a 3-tuple of strings
//and then inserts all operator combination between the entries
//Finally it prints the expression and its evaluated result
let e (a,b,c) =
let o = ["+";"-";"*";"/"]
//a double loop to get all operator combos
for x in o
do for y in o do
let s=a+x+b+y+c //z is expression to evaluate
//print the result as expression = result,
//the %.0f formatter takes care of rounding
printfn "%s=%.0f" s (q s)
//This is the entry point definition.
//A is the array of command line args as strings.
[]
let p(A:_[]) =
//Generate all permutations:
//for each index i:
// put the i-th element at the front and add the two remaining elements
// once in original order and once swapped. Voila: 6 permutations.
for i=0 to 2 do
let p,q,r = A.[i], A.[(i+1)%3], A.[(i+2)%3]
e(p,q,r) //evaluate and print "p + + q + + r"
e(p,r,q) //evaluate and print "p + + r + + q"
0 //the execution of the program apparently needs to return an integer
Example output:
> ConsoleApplication1 1 2 0
1+2+0=3
1+2-0=3
1+2*0=1
1+2/0=Infinity
1-2+0=-1
1-2-0=-1
1-2*0=1
1-2/0=-Infinity
1*2+0=2
1*2-0=2
1*2*0=0
1*2/0=Infinity
1/2+0=1
1/2-0=1
1/2*0=0
1/2/0=Infinity
1+0+2=3
1+0-2=-1
1+0*2=1
1+0/2=1
...