We propose a handy automatic composing system using some math methods and music theory knowledge to compose melodies automatically. To create the database of melodies, we first collect the information of melody clips, including lyrics, corresponding numbered musical notations and tones duration, from over 200 songs. The main procedure of our system goes as follows. After the user inputs a bunch of characters, we will use some basic math methods to find out one or multiple melody clips which match the input best and combine these melody clips by certain music theory knowledge, such as the order of sentences, important tones and chord progression. We then move to adjust the obtained melody clips according to the difference between the number of characters and the number of tones to pursue the total match and output the resultant melody. To check the performance of our system, we set up a questionnaire which includes the resultant melody sound files of each method and distribute it out for listeners to judge if the resultant melodies are harmonic.