-->
当前位置:首页 > 题库 > 正文内容

PROGRAMMING:Who won the prize

Luz3年前 (2021-05-10)题库287
ABCDEF six entries, known information is: 1) a, B at least one of the winners; 2) At least two of a, C and d won the prize; 2) B and f won the same prize; 4) C and e won the same prize; 5) If e is not obtained, then f will not be obtained; 6) At most three of C, D, e and f won the prize. Write a program to process the input winning scheme (expressed by string, such as B, C, winning may be expressed as "BC", or "C, B"... In a word, there must be letters B and C, and characters other than "ABCDEF" can be ignored) to see if all the above conditions will be met (output 0 or 1 indicates status).
###Input format:
Input the string representing the winner. The program is required to be compatible with the diversity of input forms. For example, the string representing ace three winners may be as follows: "AEC", "E, C, a", "1: A, 2: C, 3: e". That is to say, simple data filtering is required: only the information expressed by ABCDEF is processed.
###Output format:
Whether the output satisfies all the given conditions, and 0 or 1 is used to indicate the condition.
###Input sample 1:
```in
C,E,A
```
###Output sample 1:
```out
one
```
###Input sample 2:
```in
1:A,2:B,3:D
```
###Output sample 2:
```out
0
```






answer:If there is no answer, please comment

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。