|
|
Title | Find combinations of mathematical symbols that make an equation true |
Description | This example shows how to find combinations of mathematical symbols that make an equation true in Visual Basic 6. For the numbers A, B, C, D, E, and F, the program finds the +, -, *, and / symbols necessary to make A ? B ? C ? D ? E = F true. |
Keywords | combination, symbol, mathematics, equation |
Categories | Miscellany |
|
|
Thanks to Ziad Suliman.
Given six numbers A, B, C, D, E, and F, find all ways you can place +, -, *, and / symbols between them to make A ? B ? C ? D ? E = F. For example, 23 * 35 + 20 + 10 - 50 = 785.
The program loops through all of the permutations of four selections from the four symbols +, -, *, and /, calculates the result A ? B ? C ? D ? E, and compares it to F to see if the combination works. See the code for the details.
|
|
|
|
|
|