We know the youngest have to be x, but then since all their ages are consecutive, then their ages should be going up by 1. Hence,
Youngest Friend = X
Second Friend = X + 1
Last Friend = X + 2
Since we know their sum has to be 45, we can then set up the equation as
X + (X + 1) + (X + 2) = 45
or simply
3X + 3 = 45 (D)