CSU1600:Twenty-four point(DFS)
Description
Given four numbers, can you get twenty-four through the addition, subtraction, multiplication, and division? Each number can be used only once.
Input
The input consists of multiple test cases. Each test case contains 4 integers A, B, C, D in a single line (1 <= A, B, C, D <= 13).
Output
For each case, print the “Yes” or “No”. If twenty-four point can be get, print “Yes”, otherwise, print “No”.
Sample Input
2 2 3 9
1 1 1 1
5 5 5 1
Sample Output
Yes
No
Yes
HINT
For the first sample, (2/3+2)*9=24.
Source
題意:四個數字,通過四則運算看能不能得到24點
思路:對於如此小量的數,直接暴搜,你不需要懷疑人生
#include
#include
#include
#include
#include
#include