试题 试卷
题型:单选题 题类: 难易度:普通
浙江省钱塘联盟2023-2024学年高二上学期信息技术期中联考试卷
import random s="12345678"
g=""
for i in range(3):
n=len(s)
pos=random.randint(1,n-1)
g+=s[pos]
s=s[0:pos]+s[pos+1:n] print(g)
在该程序段执行时,变量 g 的值可能为 ( )
Option Base 1
Private Sub Command1Click
Dim a(4, 4)
For i = 1 To 3
For j = 1 To 3
a(i, j)=(i-1)*3+j
Next j
Next i
PRINT A(3, 1)
End Sub
程序运行后,单击命令按钮,其输出结果为( )
a(I)=68: a(2)=88: a(3)=76: a(4)= 60: a(5)=98: a(6)=100: a(7)= 64: a(8)=85: a(9)=99: a(10)=59
For i=1 To 9
b(i)=Abs(a(i+1)-a(i))
c(b(i)\10)= c(b(i)\10) + 1
For i=0 To 10
If c(i)> 0 Then Label1.Caption = Label1.Caption + "" + Str(c(i))
数组c各元素初值为0,执行该程序段,标签Label 1上显示的内容是( )
a(1) = 3:a(2) = 1:a(3) = 3
a(4) = 4 :a(5) = 6
pos = 1 : n = 5
For i = 1 To 10000
pos = (pos + a(pos) - 1) Mod n + 1
执行该程序段后,pos的值是( )
假设银行的年存储利率为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
根据上述回答下列问题:
a=[1,3,5,7,9]
x=6
for i in range(3,1,-1):
a[i+1]=a[i]
a[3]=x
#则程序执行后,a 的值为( ):
试题篮