$a+b = A, c+d = B, a + c = C, b + d = D,$ how can i find $a, b, c, d?$ $a+b = A, c+d = B, a + c = C, b + d = D$
I know it is an equation, but I have to write the equation about program.
How can I find  $a, b, c, d$?
 A: You basically can't. First of all, $D$ is unnecessary as $A+B-C=(a+b)+(c+d)-(a+c)=(b+d)=D$. So, I'll ignore it.
For any $a'\in\mathbb{R}$, $a=a',b=A-a',c=C-a',d=B-C+a'$ is a solution to your system. Main reason is, you have $4$ linear variables but only $3$ independent equations, so it is not a square matrix.
A: See
http://www.wolframalpha.com/input/?i=solve+a%2Bb+%3D+A,+c%2Bd+%3D+B,+a+%2B+c+%3D+C,+b+%2B+d+%3D+D+for+a,b,c,d
for the answer. This is a linear algebra problem. Note that a necessary condition for a solution to exist is that  $A=C+D-B$.
Given that that condition is satisfied, you have an under determined system,
so the solution is not unique.
A: You have four equations in the four unknowns so simple "elimination" should work.  Subtracting the fourth equation from the first eliminates b: a- d= A- D.  Subtracting the second equation from the third eliminates c: a- d= C- B.  But now, subtracting the second of those from the first, both a and are eliminated: 0= A- D- C+ B.  If that is not true then there is no solution.  If it is true, then there are an infinite number of solutions.
You could also write this as a matrix equation
$\begin{bmatrix}1 &  1 & 0 & 0 \\ 0 & 0 & 1 & 1 \\1 & 0 & 1 & 0 \\ 0 & 1 & 0 & 1 \end{bmatrix}\begin{bmatrix}a \\ b \\ c \\ d \end{bmatrix}= \begin{bmatrix}A \\ B \\ C \\ D \end{bmatrix}$
and observe that the coefficient matrix has determinant 0.
