当前位置: 高中信息技术 / 单选题
  • 1. (2023·绍兴模拟) 有如下Python程序段:

    lst=[3, 5, 6, 7, 10, 11, 14, 16]

    i=len(lst)-1

    stk=[0]*len(lst)

    top=-1

    while i>=0:

        if lst[i]%2==0:

            top+=1

            stk[top]=lst[i]

        else:

            lst[i+top+1]=lst[i]

            i-=1

    i=0

    while top>-1:

        lst[i]=stk[top]

        top-=1

        i+=l

    执行该程序段后,lst[3]的值是(   )

    A . 3 B . 6 C . 14 D . 16

微信扫码预览、分享更方便