当前位置: 高中信息技术 / 单选题
  • 1. (2023高三上·浙江月考) 有如下Python程序段:

    from random import randint

    from math import sqrt

    a=[0,0,0,0,0]

    for i in range(5):

        a[i]=randint(1,5)*2

    n=0

    while n<5:

        for i in range(4,n,-1):

            if a[i]<a[i-1] and int(sqrt(a[i]))!=sqrt(a[i]):

                a[i],a[i-1]=a[i-1],a[i]

        n+=1

    print(a)

    运行该程序段,输出的结果不可能是(    )

    A . [2,8,10,10,4] B . [6,8,10,4,10] C . [2,4,8,10,10] D . [6,8,6,4,8]

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