I think I understand what you're asking, though it's rather hard to say.
Ok, so there's two parts.
1. You create set C from A and B
2. You check C against the sum of set B
Arrays are extremely useful here, and they're quite simple.
That goes through numbers and couts the first, second, third, etc. If you don't understand that I would recommend taking a look at a tutorial on arrays, and basic C(++) language.
cout << numbers[n] << endl;
So, you go through c+a+b to the end.
Now for the second part, you can go through your array of numbers in B adding them up.
The above adds up all the numbers between 0 and 9, I'm sure you can think of a way to modify that to use an array from before to find the sum of all the numbers in set B.
number += n;
Then it's a case of go through each element in set C and check if sum_b <= c[n].
thats exactly what i need thank you very much but the trouble is ill still need to loop the last bit to keep updating (c) ill have a try and see if i can use arrays.
befor i just used loops but i cant rember which type i used and my program way very long