更多“I offered to pay the check, but was ____ by my friend. ”相关问题
  • 第1题:

    下列程序的输出结果是【 】。 includeclass MyClass{public: int number; void set(in

    下列程序的输出结果是【 】。

    include<iostream. h>

    class MyClass

    {

    public:

    int number;

    void set(int i);

    };

    int number=3;

    void MyClass: :set (int i)

    {

    number=i;

    }

    void main( )

    {

    MyClass my1;

    int number=10;

    my1.set(5),

    cout<<my1, number<<',';

    my1.set(number);

    cout<<my1.number<<',';

    my1.set(: :number);

    cout<<my1.number<<'.';

    }


    正确答案:5103
    5,10,3 解析:本题考查全局变量,局部变量和类的数据成员之间的使用上的差别。使用全局变量时需要用域作用符来限定该变量,否则编译器无法正确区分。

  • 第2题:

    publicclassSyncTest(privateintx;privateinty;privatesynchronizedvoidsetX(inti)(x=1;)privatesynchronizedvoidsetY(inti)(y=1;)publicvoidsetXY(int1)(setX(i);setY(i);)publicsynchronizedBooleancheck()(returnx!=y;))Underwhichconditionswillcheck()returntruewhencalledfromadifferentclass?

    A.Check()canneverreturntrue.

    B.Check()canreturntruewhensetXYiscalledbymultiplethreads.

    C.Check()canreturntruewhenmultiplethreadscallsetXandsetYseparately.

    D.Check()canonlyreturntrueifSyncTestischangedtoallowxandytobesetseparately.


    参考答案:B

  • 第3题:

    Mr. Henley has accelerated his sale of shares over the past year.

    A: held
    B: increased
    C: expected
    D: offered

    答案:B
    解析:
    题干意为“在过去的一年,亨利先生快速地抛售了他的股票。” 句中划线词意为“加速”。B项increase意为“增加”。例句:Rising prices neutralized in-creased wages.上涨的物价抵消了增加的工资。A项意为“拥有”,C项expect意为“预料”。 D项offer意为“提供”。故选B。

  • 第4题:

    publicclassSyncTest{privateintx;privateinty;publicsynchronizedvoidsetX(inti)(x=1;)publicsynchronizedvoidsetY(inti)(y=1;)publicsynchronizedvoidsetXY(int1)(setX(i);setY(i);)publicsynchronizedBooleancheck()(returnx!=y;)}Underwhichconditionswillcheck()returntruewhencalledfromadifferentclass?

    A.Check()canneverreturntrue.

    B.Check()canreturntruewhensetXYiscalledbymultiplethreads.

    C.Check()canreturntruewhenmultiplethreadscallsetXandsetYseparately.

    D.Check()canonlyreturntrueifSyncTestischangedtoallowxandytobesetseparately.


    参考答案:A

  • 第5题:

    类MyClass的定义如下: class MyClass { public: MyClass(){value=0;} SetVariable(int i){value=i;) private: int value; }; 则对下列语句序列正确的描述是( )。

    A.MyClass*p,my;p=&my;

    B.语句p=&my;是把对象my赋值给指针变量p

    C.语句MyClass*p,my;会调用两次类MyClass的构造函数

    D.对语句*p.SetV ariable(5)与语句my.SetVariable(5)等价


    正确答案:D

  • 第6题:

    苹果Pay、小米Pay和三星Pay使用哪种近距离通信技术?

    A.RFID

    B.声波

    C.NFC

    D.蓝牙


    C