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

PROGRAMMING:Yes, several questions

Luz5年前 (2021-05-10)题库383
Write a program to judge the user's judgment, and answer several questions correctly.
explain:
1 -- the standard answer is a string, which only lists the correct question number ([0, n-1], n is the number of questions). Considering the visibility and the number of questions, starting from the character '0' (the ASCII value of '0' is 48) in the ASCII code table, it means subscripts 0, 1, 2,..., specifically, the correct number represented by the character ch is ch -'0 ', for example, the standard answer string is "a? Because the ASCII values of these three characters are 97, 63 and 65 respectively, only questions 49, 15 and 17 are correct, and the rest are wrong.
2 -- take ten judgment questions as an example, the answer submitted by the user should be a string of ten in length. The position of the character represents the question number, and the correct characters are ['t ','t','y ','y','1 '], others are false. For example, the following string indicates that the user thinks the first five of the ten questions are correct and the last five are wrong: "yytt10nnff".
###Input format:
There are three lines of input:
In the first line, a positive integer representing the number of topics (the value range is [5,80]).
In the second line, a string representing the correct number set in the standard answer (counting 0 from the character 0 in the ASCII table). The title is guaranteed to be correctly identified, but it may not be arranged in an orderly manner.
In the third line, the answer options submitted by the user: a string with the same length as the number of questions, indicating the judgment of each question (use a single character to indicate whether it is correct or not, convention: one of yytt1 means correct, others are incorrect).
###Output format:
Output the correct number of user judgment questions (how many questions are the same as the standard answers).
###Input example:
```in
fifteen
907246<=>
yfYtnT101nyNtyY
```
###Output example:
```out
eight
```







answer:If there is no answer, please comment