1.问题分析:
首先请学生根据问题输入答案(每位同学需答5道关于亚运的知识题),然后小程序自动判断学生的答案是否正确,并计算学生答题的最终得分(答对1小题得2分),最后输出学生的得分及答题“对”“错”情况。
2.算法设计(在答题卡上用流程图表示)
3.编写程序(序号横线上填写上恰当的语句)
st=input("请输入你的答案(答案选项为 ABCD):")
key="DCBDA" #key值为正确答案
res="" #定义一个空字符串
for i in
if
cnt=cnt+1
res=res+"对" #将判断结果添加至 res
res=res+"错"
df=
print("你答对"+str(cnt)+"题,分数"+str(df)+",答题明细:"+res)

同类型试题

y = sin x, x∈R, y∈[–1,1],周期为2π,函数图像以 x = (π/2) + kπ 为对称轴
y = arcsin x, x∈[–1,1], y∈[–π/2,π/2]
sin x = 0 ←→ arcsin x = 0
sin x = 1/2 ←→ arcsin x = π/6
sin x = √2/2 ←→ arcsin x = π/4
sin x = 1 ←→ arcsin x = π/2


y = sin x, x∈R, y∈[–1,1],周期为2π,函数图像以 x = (π/2) + kπ 为对称轴
y = arcsin x, x∈[–1,1], y∈[–π/2,π/2]
sin x = 0 ←→ arcsin x = 0
sin x = 1/2 ←→ arcsin x = π/6
sin x = √2/2 ←→ arcsin x = π/4
sin x = 1 ←→ arcsin x = π/2

