#K94197. Taco Quiz Challenge
Taco Quiz Challenge
Taco Quiz Challenge
In this problem, you are required to simulate a simple quiz game. You will be given a series of questions, each accompanied by several answer options. Each question is provided in a single line in the format:
question_text;option1;option2;...;optionK;correct_option_index
Note that the correct_option_index
is a 1-indexed integer representing the position of the correct answer. After the questions, a single line containing space-separated integers will be provided, representing the candidate's answers, also in 1-indexed format. Your task is to display the quiz as it would be presented to the user and, after submission of the answers, display the final score. The scoring follows the simple rule: each correct answer adds 1 point. There is no penalty for incorrect answers.
Input Format: The input is read from standard input (stdin) as described below.
Output Format: The output should be printed to standard output (stdout). It first prints the quiz in a formatted manner and then the final score in the format:
Your score is X out of Q
where \(X\) is the number of correctly answered questions and \(Q\) is the total number of questions.
inputFormat
The first line of the input contains an integer Q representing the number of quiz questions. The next Q lines each contain a quiz question in the format:
question_text;option1;option2;...;optionK;correct_option_index
The following line contains Q space-separated integers representing the user's answers (1-indexed).
outputFormat
Print the quiz as it is displayed to the user. First, print "Start Quiz". For each question, print a blank line followed by the question text and then each option on a new line in the format "number. option". Finally, print the score in the format "Your score is X out of Q", where X is the number of correct answers and Q is the total number of questions.## sample
2
What is 2+2?;1;2;4;3
Capital of France?;London;Berlin;Paris;3
3 3
Start Quiz
What is 2+2?
- 1
- 2
- 4
Capital of France?
- London
- Berlin
- Paris
Your score is 2 out of 2
</code></pre>