试题 试卷
题型:单选题 题类:常考题 难易度:普通
浙江省温州十五校联合体2019-2020学年高二下学期信息技术期中考试试卷
For i = 1 To 3
For j = 1 To 6 - i
If a(j) > a(j + 1) Then t = a(j): a(j) = a(j + 1): a(j + 1) = t
Next j Next i
数组元素a(1)到a(6)的数据依次为“55,31,19,42,37,23”,则此程序运行完成后数组元素的数据依次是( )
i=0
sum=0
while i<10:
if i%2==0:
sum+=i
i+=1
print(‘sum=’,sum)
假设银行的年存储利率为3%,如果现在存储10000元钱,问多少年后连本带利超过12000元。设定:连本带利=本金*(1+利率)∧年数
假设n年后连本带息超过12000,根据题意得出数学关系式:10000*(1+3%)∧n>12000,求最小的n。
(参考程序)
Dim s as single
Dim r as single
Dim n as integer
s=10000
r=0.03
n=0
Do while
n=n+1
s=s*(1+r)
Loop
Print n;“年后”:“连本带利超过”;s
根据上述回答下列问题:
s = "abcxyz"
q = [1,2,3] + [0] * 10
head , tail = 0 , 3
res = ""
for i in s :
c = chr ((ord(i) - ord("a") + q [head]) % 26 + ord("a"))
res += c
q [tail] = q [head]
head = head + 1
tail = tail + 1
print(res)
执行该程序段后,输出的结果是( )
a=[27,5,25,36,78]
f=[False]*5
while i<4 and not f[i]:
for j in range(4, i, -1):
if a[j]<a[j-1]:
a[j], a[j-1]=a[j-1], a[j]
f[i]=True
执行该程序段后,数组f中值为True的元素个数是( )
for i in range(0,10,2):
print(" *" )
试题篮