Answer:
   78
Step-by-step explanation:
The mean is the sum of the 5 numbers, divided by 5:
   µ = (9 + 18 + 27 + 30 + x)/5 = (84 +x)/5 = 16.8 +x/5
The median of a 5-number set will be the middle number. Depending on the value of x, the mean/median may be 18, x, or 27, so we have three possible equations for x.
   16.8 +x/5 = 18
   x/5 = 1.2 . . . . . subtract 16.8
   x = 6 . . . . . . . . multiply by 5
___
   16.8 +x/5 = x
   16.8 = 4/5x . . . . subtract x/5
   21 = x . . . . . . . . . multiply by 5/4
___
   16.8 +x/5 = 27
   x/5 = 10.2 . . . . . . subtract 16.8
   x = 51 . . . . . . . . . . multiply by 5
___
The sum of the possible values of x is ...
   sum = 6 + 21 + 51 = 78