问题 单项选择题

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

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

答案

参考答案:B

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

单项选择题 B型题
阅读理解

阅读理解。

                                                                   The Worst Part

       Mom is usually home on Sunday but this week she was going to a big golf game and I was all alone in

the house. I was mad at Mom for divorcing Dad.

      I kept looking at the telephone until I couldn't stand it any longer. I picked up the receiver and dialed Dad's

number over in Bakersfield. I even remembered to dial 1 first because it was long distance."You promised to

phone me this week but you didn't," I said, feeling I had to talk to him.

      "Take it easy, kid," he said. "I just didn't get around to it. I was going to call this evening. The week isn't

over yet."

      I thought about that.

      "Something on your mind?" he asked. 

      "I hoped you would call, so I waited and waited." Then I was sorry I said it.

      "There was heavy snow in the morning," he said, "I had to chain up on highway 80 and lost time."

      I know putting chains on eight big wheels in the snow is no fun. I felt a little better, as long as we were

talking. "How is Bandit?" I asked.

      There was a funny silence. For a minute I thought the line was dead. Then I knew something must have

happened to my dog.

      "Well, kid", he began. "My name is Leigh!" I almost yelled. "I'm not just some kid you met on the street!"

      "Keep your shirt on, Leigh," he said. "When I had to stop along with some other truckers to put on chains,

I left Bandit out of the cab, I thought he would get back … I have sent out a call to CB radio, but I didn't get

an answer yet." I was about to say I understood when there came the bad part, the really bad part. I heard a

boy's voice say, "Hey, Bill, Mom wants to know when we're going out to get the pizza?"

1. From the story we know that ______. [ ]

A. Leigh's dad never had a rest on Sundays

B. Leigh was a deserted boy

C. Leigh's dad lived in another city

D. Leigh's mother often went to golf games

2. What happened to Bandit? [ ]

A. It was frozen to death.

B. It was let out of the cab and got lost

C. It was killed by a truck.

D. It ran off Highway 80 and into the mountain.

3. The underlined sentence "Keep your shirt on" probably means "______". [ ]

A. Listen to reason

B. Stop talking

C. Calm down

D. Keep warm

4. The worst part in Leigh's eyes may be that ______.[ ]

A. his dad got remarried

B. his parents got divorced

C. his dad didn't love him

D. his mom didn't take him to pizza