-->
当前位置:首页 > 题库

PROGRAMMING:Let's play the game together

Luz5年前 (2021-05-10)题库492
24 points is a puzzle game, 24 points is the four integers (generally positive integers) through addition, subtraction, multiplication and division and bracket operation, so that the final calculation result is a mathematical game of 24, 24 points can test people's intelligence and mathematical sensitivity, it can improve people's mental calculation ability in the game.
24 o'clock is usually played with playing cards. There are 52 cards left after the queen is removed from a deck of cards (if you only use 40 cards of 1-10 for initial practice), 4 cards are randomly selected (called deck), and the number on the deck is counted as 24 by adding, subtracting, multiplying and dividing (bracket can be added). Each card must be used only once. If the drawn cards are 3, 8, 8 and 9, the formula is (9-8) × eight × 3 or 3 × eight ÷( 9-8) or (9-8) ÷ 8) × 3, etc. For example, 1 5, the formula is
5*(5-(1/5));
###Input format:
Input n in the first line to represent n groups of test data, and input 4 numbers of 1-10 in the following N lines[ The number is allowed to repeat, and the test case is guaranteed to have no abnormal number]
###Output format:
If each group of test data can meet 24 points, it will output true, otherwise it will output false, the next group of results will be output after the space interval, and all the output will occupy only one line (no extra space at the end of the line).
###Input example:
```in
two
1 5 5 5
5 1 1 1
```
###Output example:
```out
True False
```






answer:If there is no answer, please comment