单选题

执行完下面一段程序后x的值是(  ).

    void main()

    {

      int a=1,b=2,c=4,d=3,x=2;

      if (a<b)

              if (c<d) 

                    x=1;

              else

                  if (a<c)

                     x=3;

                  else 

                      x=4;

      cout<<x<<endl;

     }

A.

1

B.

2

C.

3

D.

4

发表评论

登录 后再回复