试题 试卷
题型:判断题 题类:常考题 难易度:容易
粤教版(2019)高中信息技术必修1第四章 4.3运用选择结构描述问题求解过程 练习
salary=float (input( ))
if salary<=5000:
tax=0
elif salary<=7000:
tax=(salary-5000)*0.1
elif salary<=10000:
tax=200+(salary-7000)*0.2
else:
tax=800+(salary-10000)*0.4
print(salary-tax)
1)程序运行后,给出文字提示:"请输入一个正整数:"
2)输入一个整数n按回车后,程序输出从1-n所有整数中既是3的倍数又是5的倍数的数。
3)不要超过5行代码。
程序运行举例:
X=a(1):s=0
For i=2 To 5
If a(i) > x Then
x = a(i)
ElseIf a(i) < x Then
s = s+a(i)
End If
Next i
数组元素a(1)~a(5)的值依饮为“1,2,3,2,1”,执行该程序段后s的值为( )
def cal(n):
if n <= 1:
return 1
if n % 2 == 0:
return 2*cal(n-1)
执行语句k=cal(5),则k的值为( )
比如:仓库存储情况列表a=["0","A","A","B","B","A","0","0","0"],其中"0"表示空位,"A","B"表示位置上货物种类,现需从中取出一件B货物,则应从右侧取出,取完后,仓库存储列表更新为a=["0","A","A","B","A","0","0","0","0"]。
x=10
if x>=10:
y=10*x
else:
y=9*x
试题篮