Sort numbers, start adding them from the beginning until you get your number (then those numbers are those you looking for) or go over 30 (in which case that particular implementation does not work for you).
Then generate next permutation and start trying to add again.
Repeat until you exhaust all permutations.
This is a basic, introductory 'algorithms' class homework.
The idea is to see if you can figure out how to do it.
A good way to start is to get out a text editor (or a piece of paper and some crayons) and try to do it yourself. See if you can figure out a way to do it for any number in some organized way.
Once you get that, telling the computer how to do it shouldn't be that hard.
Simply add or subtrack the numbers until you are within 9, then see if the remaining numbers contain 1-9 to make your total. If not, do the same thing until you cycle though all the numbers given.
@SamualAdams
You haven't tried it first, have you?
Please only give advice once you get a working solution yourself.
Otherwise you might give bad (or confusing) advice, like you just did.
¿and that's a problem because...?
Now the only beneficiary would not be a lazy poster.
@SamuelAdams:
Your idea is incomplete as you never state how do you intend to "cycle through all the numbers given". Try to explode a little and we'll see how to adapt it.