当前位置: 高中信息技术 / 单选题
  • 1. (2022·浙江模拟) 某程序代码如下所示:

    i=1:j=100:Key=20

    Do While i<=j

        a = i+(j- i)\4: b= i+(j- i)\ 2:c=j-(j-i)\4

        If a=Key Or b=Key Or c=Key Then ExitD o

        If i<= Key And Key< a Then j= a- 1: w= w+ 1

        If a< Key And Key < b Theni = a+ 1: j= b-1:x=x+1

        If b < Key And Key < c Then i= b+1:j=c-l:y=y+1

        If c<Key And Key<=j Then i=c+1:z=z+1

    Loop

    n=w+x+y+z

    程序运行结束后,变量n的值是(    )

    A . 1 B . 2 C . 3 D . 4

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