试题

试题 试卷

logo

题型:单选题 题类: 难易度:普通

浙江百校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
举一反三
返回首页

试题篮