Answer:
We can write:
BA = B*10 + A
AB = A*10 + B
where A and B are integers.
And we know that:
AB - BA = 45
A*10 + B - B*10 - A = 45
A*9 - B*9 = 45
(A - B)*9 = 45
(A - B) = 45/9 = 5
Then we must have that A = B + 5.
then the possible values of AB are:
if B = 0, A = 0 + 5 = 5
AB = 50
if B = 1, A = 5 + 1 =6
AB = 61
if B = 2, A = 5 + 2 = 7
AB = 72
if B = 3, A = 3 + 5 = 8
AB = 83
if B = 4, A = 4 + 5 = 9
AB = 94
And we do not have more possible numbers of two digits with these conditions:
The summ of all of them will be:
50 + 61 + 72 + 84 + 94 = 360.
This is the case where AB is a positive number. (i suppose that this is what you wanted)
But let's be more complete, just because we can:
If AB can also be negative, then the possible values of AB negatives will be equal to -BA for each case of the ones shown above:
AB = -05 (this is not a two digit number, so we can discard this)
AB = -16 ------ AB - BA = -16 - (-61) = 45
AB = -27 ------ AB - BA = -27 - (-72) = 45
AB = -38 ------ AB - BA = -38 - (-83) = 45
AB = -49 ------ AB - BA = -49 - (-94) = 45
The sum if we also include these will be:
360 - 16 - 27 - 38 - 49 = 230