The card game 24: Using the first 4 randomly drawn cards, addition, subtraction, multiplication, and division, create 24. Each card must be used exactly once. For example, if the cards were {1, 1, 3, 6} we can create 24 through 1*(1+3)*6.
This is a program that calculates whether 4 entered numbers lead to a valid solution for 24 and prints out the solutions in reverse Polish notation.