Question 846445
{{{A}}}= number of sweets A has.
{{{B}}}= number of sweets B has.
{{{C}}}= number of sweets C has.
We could even define {{{N=A+B+C}}} .
 
The fact that C says
"It'd be better if B gave me two sweets. Then we'd all have the same amount!"
means {{{B-2=C+2=A}}} .
That is 3 equations, but not independent, so it is worth 2 equations.
 
The fact that B says
"If C gave me one sweet, I'd have twice as many as A does."
means that {{{B+1=2A}}} .
With that last equation, we have 3 independent equations, and that's enough to solve.
{{{system(A=B-2,A=C+2,B+1=2A)}}}
We could even add {{{N=A+B+C}}} and say we have a system of 4 linear equations, but why complicate when you can make it simpler.
 
Since two of the equations in {{{system(A=B-2,A=C+2,B+1=2A)}}} have only A and B, I can solve for A and B with just two equations:
{{{system(A=B-2,B+1=2A)}}} --> {{{system(A=B-2,B+1=2(B-2))}}} --> {{{system(A=B-2,B+1=2B-4))}}} --> {{{system(A=B-2,B+5=2B))}}} --> {{{system(A=B-2,5=B))}}} --> {{{system(A=5-2,highlight(B=5)))}}} --> {{{highlight(system(A=3,B=5)))}}}
 
Now I can use the results above and the equation I have not used to find C.
{{{system(A=3,A=C+2)}}} --> {{{3=C+2}}} --> {{{3-2=C}}} --> {{{highlight(C=1)}}}
 
Now, I can find the total
{{{A+B+C=3+5+1}}} --> {{{A+B+C=highlight(9)}}}