试题 试卷
题型:单选题 题类:常考题 难易度:普通
浙江省嘉兴市2021届高三上学期信息技术12月教学测试技术试题卷
For i=1 To 5
a(i)=Int (Rnd*9) +1
Next i
For i= 1 To 5
If i Mod2=0 Then
a(i) = a(i)\i
Else
a(i)= a(i) Mod i
End If
执行该程序段后,在下列选项中a(1)至a(5)各元素可能是( )
Dim i As Integer, m As Integer, flag as Boolean
m = {#blank#}1{#/blank#}
flag= {#blank#}2{#/blank#}
For i = 2 To int(sqr(m))
If {#blank#}3{#/blank#} Then
flag=false
Exit For
End if
If flag=true Then
Text2.Text = str(m) +"是素数"
Text2.Text = str(m) +"不是素数"
样例1:
输入: 2-163-91475-4
输出:正确
样例2:
输入: 2-163-91475-5
输出:错误
s="Dijob 2023" s1=""
for i in range(0,len(s)):
c=s[i]
if "a"<=c<="z" or "A"<=c<="Z":
s1=s1+chr(ord(c)-1)
else:
s1=c+s1 print(s1)
程序运行后,输出的结果是 ( )
求和:计算s=1++++…++。
s={#blank#}1{#/blank#}
for i in range(1, {#blank#}2{#/blank#}):
s=s+{#blank#}3{#/blank#}
print("s=",str(s))
from random import randint
res=" "
i,j=0,len(s)-1
while i<len(s) and j>=i:
if randint(0,1) == 0: #randint(0,1)随机生成 0 或 1
res+=s[i]
i+=1
res+=s[j]
j-=1
试题篮