Assuming you made an error typing the question out, and the formula should say 30g, as it's $30 a round:

45 = (x) + (x + 1) + (x + 2)
45 = 3x + 3
- 3
42 = 3x
/3
14 = x
45 = 14 + (14 + 1) + (14 + 2)
45 = 14 + 15 + 16
The ages of the 3 friends are 14, 15, and 16.
X=16
I use Tiger Algebra for help and it gives me all the correct work and answers as i need them!! TRY USING IT TODAY!!!!!