试题 试卷
题型:填空题 题类:常考题 难易度:普通
浙教版初中信息技术九年级上学期期末试卷(12)
Dim i As Integer, sum As Integer
sum = 0
For i = 2 To 10
If i Mod 2 <> 0 And i Mod 3 = 0 Then
sum = sum + i
End If
Next i
Print sum
End Sub
程序运行后,单击窗体,输出结果为。
For {#blank#}1{#/blank#} to 9
For b=0 to 9
For c=0 to 9
For d=0 to 9
X={#blank#}2{#/blank#}
If {#blank#}3{#/blank#} then
print x
End if
Next d
Next c
Next b
Next a
s=0
For i=5 to -3 step-6
s=s+i
a,b=[0]*10,[False]*10
i=0
while i<=9:
if not b[r]:
a[i]=r
i=i+1
print(a)
则划线处的代码依次是( )
① r=random.randint(0,10)
② b[r]=True
③import random
④ b[i]=True
⑤from random import randint
⑥ r=random.randint(0,9)
百千白鸡问题是经典的数学问题,原题为“鸡翁一,值钱五;鸡母一,值钱三;鸡雏三,值钱一;百钱买百鸡,则翁、母、雏各几何?”翻译过来,意思是公鸡一个五块钱,母鸡一个三块钱,小鸡三个一块钱,现在要用一百块钱买一百只鸡,问公鸡、母鸡、小鸡各多少只?
import random
while True:
x=random.randrange(0,20)
y=random.randrange(0,33)
z=random.randrange(0,100)
if 5*x+3*y+z/3==100 and x+y+z==100:
print('公鸡',x)
print('母鸡',y)
print('小鸡',z)
1)def factoria1(n): #求n!
2) s=1
3) for i in range(2,n+1)::
4) s=s*i
5) return s
6)print(factorial(4))
试题篮