大家好,有下面的一个
文本文件,想用Qt处理得到下面的效果:
mapNumLetter[题号][QUES] = 题目,
mapNumLetter[题号][STAND] = 标准答案,
mapNumLetter[题号][选项序号] = 选项值,
例如:
mapNumLetter['3.']['QUES'] = 'It is better to add a semicolon at the end of line in block in order to build a good program style.'
mapNumLetter['3.']['STAND'] = 'A'
mapNumLetter['3.']['A.'] = 'True'
...............
mapNumLetter['10.']['QUES'] = 'The ____ function removes the given key (and its corresponding value) from the hash.'
mapNumLetter['10.']['STAND'] = 'D'
mapNumLetter['10.']['A.'] = 'del'
...............
mapNumLetter['34.']['QUES'] = '"1 $1" is generated by ____ while my $price=1;'
mapNumLetter['34.']['STAND'] = 'A'
mapNumLetter['34.']['A.'] = 'print <<EOF; \
"$price \$1" \
EOF'
mapNumLetter['34.']['B.'] = 'print <<'EOF'; \
"$price \$1" \
EOF'
.....................
但不知道Qt 中是否支持多重哈希Key,如何赋值,大神们能够指导下小白吗? 例如perl中多重哈希Key可以记作:
$hExam{'3.'}{'QUES'} = 'It is better to add a semicolon at the end of line in block in order to build a good program style.';
输入文件为:
- 3. It is better to add a semicolon at the end of line in block ( A )
- in order to build a good program style.
- A. True B. Flase
- 10.The ____ function removes the given key ( D )
- (and its corresponding value)
- from the hash.
- A. del B. remove C. cut D. delete
- 34."1 $1" is generated
- by ____ while my $price=1; ( A )
- A. print <<EOF; \
- "$price \$1" \
- EOF
- B. print <<'EOF'; \
- "$price \$1" \
- EOF
- C. print <<`EOF`; \
- echo "$price \$1" `date +%Y` \
- EOF