\(n_{H_2}=\dfrac{8,96}{22,4}=0,4mol\\ n_{Al}=a;n_{Mg}=b\\ 2Al+6HCl\rightarrow2AlCl_3+3H_2\\ Mg+2HCl\rightarrow MgCl_2+H_2\\ \Rightarrow\left\{{}\begin{matrix}1,5a+b=0,4\\27a+24b=7,8\end{matrix}\right.\\ \Rightarrow a=0,2;b=0,1\\ \%m_{Al}=\dfrac{0,2.27}{7,8}\cdot100=69,23\%\\ \%m_{Mg}=100-69,23=30,77\%\)