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

PROGRAMMING:Yes or no (multiple choice)

Luz5年前 (2021-05-10)题库431
Write a program to store the standard answers of multiple-choice questions in a reasonable scheme, and compare the results with the answers submitted by the practitioners (the answers are exactly the same as the standard answers, which are regarded as correct).
Note: 1 -- take the questions with four options as an example, the standard expression characters are in the set [abcdabcd0123], but the answer string entered by the user may have non-standard characters, and the program should have the function of filtering.
2 -- take the multiple-choice question with four options as an example, if the standard answer is "ad", then "Da", "3,0", "a, Da", "AA, de" are all correct answers (regardless of the order of arrangement and illegal characters).
###Input format:
There are three lines
Number of choices (2-8).
Standard answer string, length not more than 8. For example: "a, D", "03".
User answer string, length not more than 8. For example: "D, a, a", "a, B, C, O".
###Output format:
There are three lines
The internal binary representation of the standard answer ([] is an eight bit binary number).
The built-in binary representation of the user's answer ([] is an eight bit binary number).
The complete match of the two answers: logical value (0 | 1 indicates the match status).
###Input example:
```in
four
ACD
a,F,d,2
```
###Output example:
```out
[00001101]
[00001101]
one
```







answer:If there is no answer, please comment