试题 试卷
题型:单选题 题类:常考题 难易度:普通
【gb】浙江省绍兴市海亮高级中学2020-2021学年高一下学期信息技术期中考试试卷
x=4095
s1="ABCDEFGHIJ"
s2="abcdefghij"
ret=""
while x>0:
r=x % 10
if r % 2==1:
ret=s1[r]+ret
else:
ret=ret+s2[r]
x=x//10
print(ret)
from math import *
def isPrime(x): # 判断是否为素数
i = 2
while :
if x % i == 0:
return ①
i += 1
return True
count = 0
for p in range(2, 50): # 判断否为梅森素数
if ② :
m = ③
if isPrime(m) == True:
print(m)
count += 1
print("2的50次方减1以内的梅森素数共有:" + ④ + "个")
#求0~50的所有偶数的和
s={#blank#}1{#/blank#}
for i in range(0, {#blank#}2{#/blank#} , {#blank#}3{#/blank#}):
s=s+{#blank#}4{#/blank#}
print("0~50所有偶数的和为", {#blank#}5{#/blank#})
a = [ 5 , 4 , 2 , 1 , 3 , 6 ] ; q = [ 0 ] * 6 ; head = tail = 0
for i in range( len( a ) ):
if a[ i ] % 2 == 1 :
q[ tail ] = a[ i ] ; tail = tail + 1
elif head < tail :
head += 1
print( tail – head )
执行该程序段后,输出结果为( )
试题篮