问题 单项选择题

执行下面程序后输出的正确结果是【 】public class Test{ public static void main(String args[]){ System.out.print(100%3); System.out.print(","); System.out.print(100%3.0);}}

A.1,1

B.1,1.0

C.1.0,1

D.1.0,1.0

答案

参考答案:B

解析:本题考查Java语言%运算符的使用。%运算符是模数除,也就是求余,表达式为:op1%op2Java中的二元运算符适用于所有数值型数据类型,但需要注意,如果两个操作数全是int型,结果也是int型,100%3=1:如果两个操作数全是float型,或其中一个是 float型,而另外一个是整型时,表达式结果是float型,100%3.0=1.0,所以选项B为正确答案。务必注意操作数类型不同时运算结果的类型。

完形填空

About a year ago, a couple with three children moved into the apartment next door to me.

I never heard any noise from the children, but I often heard the parents shouting at the kids, not in a nice voice, but in a terrible one.

小题1:_______________. I always greeted them, but the only answer I ever got was a “hello” from the eight-year-old girl. 小题2:__________________. One day, when I returned from the hospital, the family were just leaving their apartment and the little girl was holding the outside gate open for the others. I remained in the car doing something unnecessary because I didn’t want to be snubbed(冷落、怠慢)again. When I finally got out of my car and walked towards the gate, the parents were telling the little girl to hurry and get in the car. 小题3:_________________. I hurried though I was still in pain from my leg.

Later that day I wrote a note saying how much her act of kindness had touched an old man’s heart.

The next day the family came over. 小题4:__________________. Her parents thanked me as well.

Now when we meet in the hall, we always greet each other, in a friendly way.

Last night there was a heavy snow. 小题5:_________________. I looked out of the window, thinking what I could do. To my great surprise, there was no snow on my car at all! I was even more surprised to see the lovely girl standing by the gate with an old broom.

Isn’t it amazing that the little kind act of an eight-year-old girl can change so many things for the better?

根据材料内容,将下面五个选项中选出能填入文中空缺处的最佳选项,使文章内容意思通顺,内容完整,并将其标号填写在下面题号后的横线上。

A.I wondered how to go to my doctor’s without a car because I can only walk for a short time and then have to rest for a while.

B.We often met in the hallway.

C.The little girl was quite proud of her behavior and thanked me.

D.These years I usually go out to see the doctor because of the pain in my leg.E. I saw the little girl was still keeping the gate open, waiting for me!

填空题