## CCC '11 S2 - Multiple Choice

View as PDF

Points: 5
Time limit: 2.0s
Memory limit: 64M

Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig
##### Canadian Computing Competition: 2011 Stage 1, Senior #2

Your teacher likes to give multiple choice tests. One benefit of giving these tests is that they are easy to mark, given an answer key. The other benefit is that students believe they have a one-in-five chance of getting the correct answer, assuming the multiple choice possibilities are A, B, C, D or E.

Write a program that your teacher can use to grade one multiple choice test.

#### Input Specification

The input will contain the number () followed by lines. The lines are composed of lines of student responses (with one of A, B, C, D or E on each line), followed by lines of correct answers (with one of A, B, C, D or E on each line), in the same order as the student answered the questions (that is, if line is the student response, then line contains the correct answer to that question).

#### Output Specification

Output the integer () which corresponds to the number of questions the student answered correctly.

#### Sample Input 1

3
A
B
C
A
C
B

#### Output for Sample Input 1

1

#### Sample Input 2

3
A
A
A
A
B
A

#### Output for Sample Input 2

2

• commented on Dec. 1, 2018, 9:21 p.m.

Can someone help me with my solution. I keep getting a runtime error.

• commented on Dec. 2, 2018, 6:11 a.m.

Check the second loop you don't want the condintion i<SIZE

• commented on Dec. 3, 2018, 5:52 p.m.

Thank you very much.

• commented on Aug. 23, 2018, 5:55 p.m.

This comment is hidden due to too much negative feedback. Click here to view it.

• commented on May 26, 2020, 5:29 p.m. edited

How do I delete this? Waaaaaaaa

• commented on Oct. 6, 2019, 10:07 a.m.

This comment is hidden due to too much negative feedback. Click here to view it.