Morteza Kashi
|
An interesting program using recursive function: This program reads some integers from an input file "input.txt". This input file consists of some integers. The first integer is the number of the integers in a list. The next integers are some integers whose number is equal to the first integer in the list .The rest of the integers are some sums. This program finds all compositions of integers in the list which make each sum in the list. The program print out the result in an output file "output.txt" appropriately. For example The following series of integers could appear in a n input file and mean as following: 5 2 3 4 1 9 7 5 10 The first integer says that we have five integers and they are {2,3,4,1,9} and we have the following sums: {7,5,10} For each sum, the program should find all combination if the mentioned integers whose summation is equal to that sum. For example for the integer 7, the program should find the combination of {3,4} or any other combination of the integers whose summation is 7. For the sum 5 the program should find the combination of {2,3} and {4,1}.If there is no combination for any sum, the program should give an appropriate message. You can find my C++ code for doing the above task program by clicking on the following: Please contact me by clicking HERE and filling out the coming simple form, should you have any question about this program.
|