日期:2024-05-28

浙江百校2023年9月高三信息技术起点调研测试卷试题详情

有如下 Python程序:

q=[0]*6

q[0]=1

head=0; tail=1

while tail<len(q)=1:

    x=q[head]

    if x%2==0:

        q[tail]=x//2

        tail+=1

    else:

        q[tail]=x*2

        q[tail+1]=x*3

        tail+=2

head+=1

程序运行后 , tail-head的值为(   )

A、3
B、4
C、5
D、6

试题所涉知识点

知识点

试题被试卷采用

1