Why is \$A=10V\$, not \$-30V ?\$
You have to pay attention to the signs of the voltages. 

Look from A to B and count the voltage from 0V. 

Across R1 is 0, so we have 0V at the next node

Across V1 is -10V so we have -10V at the next node

Across V2 is +20V so we have +10V at B 

Similarly Vcd is -30 + 0 -10  + 20 + 0 = -20, which disagrees with your solution, so either it's Vdc or the answer given is incorrect.