问题 单项选择题

设有以下语句:
char x=3, y=6, z;
z=x^y<<2;
则z的二进制值是( )。

A) 00010100
B) 00011011
C) 00011100
D) 00011000

答案

参考答案:B

解析: 本题考查两个位运算符。按位异或运算符“^”是双目运算符,其功能是参与运算的两数各对应的二进位相异或,当两对应的二进位相异时,结果为1。左移运算符“<<”是双目运算符,其功能是把“<<”左边的运算数的各二进位全部左移若干位,由“<<”右边的数指定移动的位数,高位丢弃,低位补0,并且“<<”运算符的优先级高于“^”。

单项选择题
完形填空
Many years ago when the world was a simpler place there lived a shoemaker. He used __16__ silk and soft leather(皮革) to make the greatest shoes. Colorful shoes lined the shelves of his store.
One little girl, Rachel, often looked through the _17__ into the store. One day while Rachel was looking again, the shoemaker __18__ at her side. “Well, dear, which shoes would you take?” he said, smiling.
Rachel was __19__ as she hadn’t noticed the little man. “Oh! I …I was just __20__,” Rachel said. “I can’t afford them and I would never take anything that doesn't belong to me.”
The shoemaker said, “I meant to give you a pair as a(n) __21__ .” Rachel stared at the shoemaker. A small pointed(尖尖的) ear could be seen underneath(在…底下) his hat. The guy __22__ Rachel’s curious gaze(凝视) and fixed his hat tightly over his ear _23__.
“Why don't you wear a pair of your own beautiful shoes?” Rachel questioned him, smiling.
“I am always working and have no need of __24__ shoes,” he explained.
Rachel’s smile __25__. “I have no need of good shoes either,” Rachel said in a sad voice and limped (一瘸一拐地走) away.
A few days later, Rachel was walking past the shoe shop when the shoemaker waved her into the shop. Looking around, Rachel said, “You have every color of the rainbow here.”
The shoemaker said, “They are the colors of the rainbow, Rachel.” __26__ a drawer(抽屉), he took out the most beautiful pair of shoes Rachel had ever seen. The shoemaker placed the shoes onto her feet. “Take a __27__, Rachel,” he said.
“I …I can’t,” Rachel said with a tear.
“Yes, Rachel, you can,” the shoemaker __28__.
Rachel stood up staight. Deliberately(小心翼翼地) she took a __29__, followed by another and another. “I can do it. I can do it,” she said, walking easily across the floor, not limping at all.
The shoemaker laughed __30__ and said, “I told you they were magic shoes…”
小题1:
A.wonderfulB.professionalC.personalD.skillful
小题2:
A.floorB.windowC.wallD.corner
小题3:
A.quitB.appearedC.fellD.hid
小题4:
A.excitedB.confusedC.interestedD.surprised
小题5:
A.searchingB.movingC.wavingD.looking
小题6:
A.collectionB.presentC.solutionD.exchange
小题7:
A.noticedB.guidedC.rememberedD.accepted
小题8:
A.exactlyB.quicklyC.happilyD.kindly
小题9:
A.cleanB.largeC.newD.fine
小题10:
A.disappearedB.wonderedC.advancedD.improved
小题11:
A.RepairingB.MakingC.DesigningD.Opening
小题12:
A.restB.breathC.bathD.walk
小题13:
A.complainedB.questionedC.encouragedD.appreciated
小题14:
A.stepB.smileC.riskD.seat
小题15:
A.carefullyB.heartilyC.directlyD.quietly