Skip to content

renm10/CombFinder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Combination Finder Algorithm

jpn

This is an algorithm made from scratch that lists all possible patterns given a candidate list of numbers that add to a certain sum.

How to use

  1. Edit LINE 2 of the numberselect.txt file and enter the candidate numbers separated by a space. Ex. 9 12 4 3

  2. Edit LINE 4 of the same file and enter the sum that the candiates may add to.

  3. Save the file

  4. Compile

    g++ main.cpp
    
  5. Run

    ./a.out //For Unix
    ./a.exe //For Windows
    

Example

Sample Input

Inside numberselect.txt File:

1    Enter the candidate numbers separated by a space: Ex. 1 9 12 14
2    1 2 3 //User Input
3    Enter the Sum: Ex. 13
4    4    //User Input

Sample Output:

Combination:
1 1 1 1
Combination:
2 1 1
Combination:
1 2 1
Combination:
3 1
Combination:
1 1 2
Combination:
2 2
Combination:
1 3

TODO

  • Potentially check if the user did not enter two of the same numbers in the txt file.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors