consider co2,
% of carbon =27.27
% of oxygen=100-27.27=72.73
27.27g of carbon combine with 72.73g of oxygen
hence 1g of carbon combines with 72.73/27.27 = 2.67 g of oxygen
consider cs2,
% of carbon =15.79
% of oxygen=100-15.79=84.21
15.79g of carbon combine with 84.21g of oxygen
hence 1g of carbon combines with 84.21/15.79 = 5.33 g of sulphur
the ratio of diff masses of sulphur and oxy combining with fixed mass of carbon is
5.333:2.67 =2:1