//Written by Mo Kashi #include #include #include ofstream fout; ifstream fin; int freeze; bool checkSum(int[],int,int); void Read_file_and_process(){ //This method reads all numbers in the file as was told in //above and put all n numbers in an array and find all // sums and find composition of sums int list_size; int number; int sum; fin.open("C:\\input.txt"); fout.open("C:\\output.txt"); fin>>list_size; int list[list_size]; for(int i=0;i>number; list[i]=number; }//for fout<<"Here is the list of numbers:"<>sum;//gets the first sum from input file while(fin){ fout<<"====================================="<>sum; }//while }//Read_file_and_process() bool checkSum( int list1[],int sum,int n){ //This method specifies if the sum can be made of the integers //in the list .If so ,it prints out all of those integers and //if not in says "sum not found" if(sum==0) return true; else if(n==0||sum<0) return false; else{ if (checkSum(list1,sum-list1[n-1],n-1)){ fout<>freeze; }//main()