Recently, the superconducting transition temperature 𝑇𝑐=287K has been experimentally obtained in a material composed of carbon, sulfur, and hydrogen under a high pressure of 267 GPa. The material structure is currently unknown, where carbon and sulfur were added at a molar ratio of 1:1. Here, fixing the molar ratio of C:S=1:1, we studied several possible C-S-H structures, and found a stable structure C2S2H4 using first-principles calculations. C2S2H4 shows an insulator-to-metal transition and a superconducting ground state at a pressure of 64 GPa, and its 𝑇𝑐 can reach 16.5 K at 300 GPa. In addition, we found another stable structure of C2S3H4, whose 𝑇𝑐 is 47.4 K at 300 GPa. The calculations show that the added S atom in C2S3H4 breaks part of the C-H bonds in C2S2H4, makes the vibration of H atom occur at a lower frequency, and thus enhances the electron-phonon coupling and 𝑇𝑐. Our results suggest that a molar ratio of C:S lower than 1:1 in C-S-H systems may be favorable to enhance 𝑇𝑐. This can be useful to figure out the structure of a C-S-H material with room-temperature 𝑇𝑐 in a recent experiment.