问题 单项选择题

以下程序输出结果为( )。 class test 2 { public static void main(String args[]) { int n = 7; n<<=3; n=n&n+1|1n+2^n+3; n>>=2; System.out.println(n); } }

A.0

B.-1

C.14

D.64

答案

参考答案:C

解析: 第1个赋值语句使得n的值为7, 7的二进制形式为00000111,第2个赋值语句可写为n=n<<3,n左移3位的结果为 00111000,即第3个赋值语句的运算顺序为 (((n&n)+(1|n))+(2^n))+3,运算结果为57(十进制),其二进制形式为00111001,第4个赋值语句使n的值右移2位,由于n的符号位为0,因此,在右移时左边填充位为0,即 00001110,其十进制形式为14。

完形填空
阅读下面短文,掌握其大意,从每题所给的A、B、C、D四个选项中,选出最佳选项。
Nowadays lots of students ask their parents for money to buy things they like. For me, to ask for money is like entering a(n) _36__. I learned this from  37 .
Last year my mother told me that the _ 38  way I would get a driver’s license before I turned eighteen depended on _ 39  I paid for the classes myself. “What?” I asked in _ 40  . But I knew _ 41  that my reasoning would have no_ 42  on the situation,  43__ by the look on my mother’s face.
Three weeks later, I started working _ 44  a hostess at a factory, twice a week. A month later I paid $ 270 for driving lessons, and then over $ 20 to _ 45  my permit test. My pockets were empty _ 46  as soon as they were filled.
My mother thought that I’d be _ 47  to do things without her help. The funny thing was that even though I was totally _ 48  in the beginning, I truly appreciated it, _ 49  if I had just been handed bills from her.
When I realized that my mother wasn’t going to _ 50  something like a driver’s license, at first, it seemed as if she had __51__ an immovable block before me and I would never _ 52  it. But my mother was __53 _. She knew that I wanted a luxury(奢侈品)but _ 54  me to get it. That is as _ 55  as this ---- if I really want it, I’ll find a way to get it myself.
小题1:
A.officeB.prisonC.battlefield D.bank
小题2:
A.facts B.experienceC.lessonsD.quarrels
小题3:
A.best B.properC.sameD.only
小题4:
A.whetherB.thatC.howD.when
小题5:
A.troubleB.disbeliefC.comfortD.horror
小题6:
A.hurriedlyB.jokinglyC.instantlyD.surprisingly
小题7:
A.effectB.senseC.effortD.result
小题8:
A.judgedB.judgingC.to judgeD.being judged
小题9:
A.withB.forC.likeD.as
小题10:
A.pass B.takeC.holdD.gain
小题11:
A.almostB.evenC.still D.yet
小题12:
A.readyB.likelyC.unhappy D.unable
小题13:
A.terrifiedB.annoyedC.tiredD.disturbed
小题14:
A.more than B.rather thanC.no moreD.no longer
小题15:
A.payB.raiseC.buyD.support
小题16:
A.laidB.layC.liedD.lain
小题17:
A.get aboutB.get by C.get throughD.get over
小题18:
A.wiseB.mistakenC.strictD.kind
小题19:
A.daredB.hoped C.encouragedD.expected
小题20:
A.well B.farC.soonD.simple
填空题