If the solubility is #S#, there are #S# g solute in 100 g solvent.
#"Total mass of solution" = (S + 100)color(white)(l) "g"#
#"% by mass" = "mass of solute"/"mass of solution" × 100 % = (S color(red)(cancel(color(black)("g"))))/((S+100) color(red)(cancel(color(black)("g")))) × 100 %#