Multiple Choice
InterviewTime limit2sMemory limit512 MB
Read a student's N answers followed by the N correct answers, and count how many positions match.
- Level
Easy1 of 10
- Topics
- Array, Implementation
- Solved
- No attempts yet
Problem
Your teacher likes to give multiple-choice tests. One benefit of these tests is that they are easy to grade, given an answer key. Another is that students believe they have a one-in-five chance of guessing the correct answer, since each question offers the choices A, B, C, D, or E.
Write a program that grades a single multiple-choice test.
Input
The first line contains an integer (). It is followed by lines: the first lines are the student's responses (one of A, B, C, D, or E per line), and the next lines are the correct answers (one of A, B, C, D, or E per line), in the same order as the questions. That is, if line is the student's response to a question, then line is the correct answer to that same question.
Output
Output a single integer (): the number of questions the student answered correctly.